Phaser API Documentation

  Version: 
container([x], [y], [children])

Description:

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

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

Parameters:

name type arguments description
x number <optional>

The horizontal position of this Game Object in the world.

y number <optional>

The vertical position of this Game Object in the world.

children Phaser.GameObjects.GameObject | Array.<Phaser.GameObjects.GameObject> <optional>

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

Returns:
Description:

The Game Object that was created.