Phaser API Documentation

  Version: 
layer([children])

Description:

Creates a new Layer Game Object and adds it to the Scene.

Note: This method will only be available if the Layer Game Object has been built into Phaser.

Parameters:

name type arguments description
children Phaser.GameObjects.GameObject | Array.<Phaser.GameObjects.GameObject> <optional>

An optional array of Game Objects to add to this Layer.

Returns:
Description:

The Game Object that was created.

Since: 3.50.0