Phaser API Documentation

  Version: 
moveTo(child, index)

Description:

Moves a Game Object to a new position within this Container.

The Game Object must already be a child of this Container.

The Game Object is removed from its old position and inserted into the new one. Therefore the Container size does not change. Other children will change position accordingly.

Parameters:

name type description
child Phaser.GameObjects.GameObject

The Game Object to move.

index number

The new position of the Game Object in this Container.

Returns:
Description:

This Container instance.

Examples:
Since: 3.4.0