Phaser API Documentation

  Version: 
<static> CenterOn(gameObject, x, y)

Description:

Positions the Game Object so that it is centered on the given coordinates.

Parameters:

name type description
gameObject Phaser.GameObjects.GameObject

The Game Object that will be re-positioned.

x number

The horizontal coordinate to position the Game Object on.

y number

The vertical coordinate to position the Game Object on.

Returns:
Description:

The Game Object that was positioned.

Since: 3.0.0