Working with parent objects
In Phaser, only two type of scene objects can be used as a “container” or a “parent” of other objects: the Container, and the Layer objects.
In the next section you can learn about operations common to both type of objects.
Moving an object to a parent
You can move an object to a new parent. The command Move To Parent opens the Parent dialog. This dialog shows all the available parents for the object (including the Display List) and you can select the new parent.
The command can be executed by pressing the Shift+P
keys, selecting the Move To Parent option in the context menu, or pressing the Parent button in the Parent section of the Inspector view.
Breaking a parent
The Break Parent command removes a Container or Layer, but keeps its children. The children are added to the parent of the parent, and their preserve the same absolute position.
You can execute the command by pressing the Shift+B
keys or selecting the Break Parent option of the Parent context menu.
Selecting the parent of an object
The Select Parent command selects the parent of an object. To execute the command press the P
key or click on the Select Parent option of the Parent context menu.
Selecting the children of an object
The Select Children command selects the children of a container or a layer. To execute this command, press the N
key or click on the Select Children option in the Parent context menu.
Changing the rendering order of children
You can change the rendering order of an object. The context menu shows the Depth commands, to move the objects in different directions: