Phaser API Documentation

  Version: 
<static> CenterOn(triangle, x, y, [centerFunc])

Description:

Positions the Triangle so that it is centered on the given coordinates.

Parameters:

name type arguments description
triangle Phaser.Geom.Triangle

The triangle to be positioned.

x number

The horizontal coordinate to center on.

y number

The vertical coordinate to center on.

centerFunc CenterFunction <optional>

The function used to center the triangle. Defaults to Centroid centering.

Returns:
Description:

The Triangle that was centered.

Since: 3.0.0