Phaser home
Phaser AE
Open source
Phaser 4
Download
Learn
Editor
Tools
Docs
Examples
News
Log in
Examples
/
Game Objects
/
Layer
Phaser 4.1.0
Phaser 4 examples
Layer
8
examples
Examples
8
Add Sprite to Layer
Learn how to add multiple existing Sprites to a Layer object and toggle the visibility of the entire group.
Create Layer
Demonstrates how to create a Layer Game Object to group sprites and toggle their visibility collectively.
Depth Sort Layer Children
Demonstrates how to use the depth property to automatically sort Game Objects within a Layer, creating a pseudo-3D effect based on their vertical position.
Layer Filter
Demonstrates applying a post-processing filter to a Layer object to affect all of its children simultaneously, while leaving objects outside the layer untouched.
Layer with Bitmap Mask
Demonstrates how to apply a bitmap mask to an entire Layer, ensuring all children within the layer are masked by a single external image.
Layer With Geometry Mask
Demonstrates applying a geometry mask to a Layer object, allowing you to clip all of the layer's children simultaneously using a single mask shape.
Move Between Layers
Demonstrates how to transfer Game Objects between different Layers dynamically. Moving an object to a new Layer updates its rendering context, allowing it to inherit different filters and display list properties.
Nested Layers
Demonstrates how to nest one Layer within another to create a hierarchy, showing how visibility states propagate from parent layers to their children.