Instance Method

moveToParent:

Moves the node to a new parent node in the scene.

Declaration

- (void)moveToParent:(SKNode *)parent;

Parameters

parent

An SKNode object to move the receiver to. This node must be in the same scene as the node’s current parent.

Discussion

The node maintains its current position in scene coordinates.

See Also

Modifying the Node Tree

Accessing and Modifying the Node Tree

See the objects and functions you use to control the node tree's composition.

- addChild:

Adds a node to the end of the receiver’s list of child nodes.

- insertChild:atIndex:

Inserts a node into a specific position in the receiver’s list of child nodes.

- isEqualToNode:

Compares the parameter node to the receiving node.

- removeFromParent

Removes the receiving node from its parent.

- removeAllChildren

Removes all of the node’s children.

- removeChildrenInArray:

Removes a list of children from the receiving node.

- inParentHierarchy:

Returns a Boolean value that indicates whether the node is a descendant of the target node.