* Change the parent of this node while keeping the absolute transform. * * @remarks * After performing this operation, the node will stay in the same place * visually, but its parent will be changed. * * @param newParent - The new parent of this node.
(newParent: Node)
| 969 | * @param newParent - The new parent of this node. |
| 970 | */ |
| 971 | public reparent(newParent: Node) { |
| 972 | const position = this.absolutePosition(); |
| 973 | const rotation = this.absoluteRotation(); |
| 974 | const scale = this.absoluteScale(); |
| 975 | newParent.add(this); |
| 976 | this.absolutePosition(position); |
| 977 | this.absoluteRotation(rotation); |
| 978 | this.absoluteScale(scale); |
| 979 | } |
| 980 | |
| 981 | /** |
| 982 | * Remove all children of this node. |