Phaser home
Phaser AE
Open source
Phaser 4
Download
Learn
Editor
Tools
Docs
Examples
News
Log in
Examples
/
Game Objects
/
Display List
Phaser 4.1.0
Phaser 4 examples
Display List
8
examples
Examples
8
Add to Container
Demonstrates how to dynamically create Sprites and add them to a Container object on user input, while tracking the container's size.
Add To Display List
Demonstrates how to manually add a Game Object to a Scene's display list using the addToDisplayList method after instantiating it with a constructor.
Move Game Objects Between Containers
Demonstrates how to dynamically transfer Game Objects from one Container to another at runtime, updating their parent and tracking container sizes.
Move Sprites Between Layers
This example demonstrates how to move Game Objects between different Layer containers. Clicking a sprite transfers it from one Layer to another, updating the display list hierarchy.
Moving Objects Between Scene and Container
Demonstrates how to transfer Game Objects between the global Scene display list and a Container, showing how parentage and list sizes automatically update.
Moving Sprites Between Display List and Layer
Learn how to move Game Objects between the Scene's main display list and a Layer. This example shows how to use layer.add and addToDisplayList to transfer objects between containers.
Remove From Display List
Demonstrates how to remove Game Objects from the Scene's display list using the removeFromDisplayList method upon user interaction.
Swap Game Objects Between Containers
Demonstrates how to move sprites between different Container instances dynamically and track container child counts.