Phaser API Documentation

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

Description:

Moves the top-left corner of a Rectangle so that its center is at the given coordinates.

Parameters:

name type description
rect Phaser.Geom.Rectangle

The Rectangle to be centered.

x number

The X coordinate of the Rectangle's center.

y number

The Y coordinate of the Rectangle's center.

Returns:
Description:

The centered rectangle.

Since: 3.0.0