Navigation
These archived docs are for Phaser 2.6.1 Phaser 3 docs can be found on newdocs.phaser.io.
Phaser CE docs can be found on the Phaser CE Documentation site.

Constructor

Phaser.Component. BringToTop

new BringToTop()

The BringToTop Component features quick access to Group sorting related methods.

Source code: gameobjects/components/BringToTop.js (Line 12)

Public Methods

bringToTop() → {PIXI.DisplayObject}

Brings this Game Object to the top of its parents display list. Visually this means it will render over the top of any old child in the same Group.

If this Game Object hasn't been added to a custom Group then this method will bring it to the top of the Game World, because the World is the root Group from which all Game Objects descend.

Returns
PIXI.DisplayObject -

This instance.

Source code: gameobjects/components/BringToTop.js (Line 24)

moveDown() → {PIXI.DisplayObject}

Moves this Game Object down one place in its parents display list. This call has no effect if the Game Object is already at the bottom of the display list.

If this Game Object hasn't been added to a custom Group then this method will move it one object down within the Game World, because the World is the root Group from which all Game Objects descend.

Returns
PIXI.DisplayObject -

This instance.

Source code: gameobjects/components/BringToTop.js (Line 87)

moveUp() → {PIXI.DisplayObject}

Moves this Game Object up one place in its parents display list. This call has no effect if the Game Object is already at the top of the display list.

If this Game Object hasn't been added to a custom Group then this method will move it one object up within the Game World, because the World is the root Group from which all Game Objects descend.

Returns
PIXI.DisplayObject -

This instance.

Source code: gameobjects/components/BringToTop.js (Line 66)

sendToBack() → {PIXI.DisplayObject}

Sends this Game Object to the bottom of its parents display list. Visually this means it will render below all other children in the same Group.

If this Game Object hasn't been added to a custom Group then this method will send it to the bottom of the Game World, because the World is the root Group from which all Game Objects descend.

Returns
PIXI.DisplayObject -

This instance.

Source code: gameobjects/components/BringToTop.js (Line 45)