Phaser API Documentation

  Version: 

Member of: Phaser.Geom.Polygon

<static> GetPoints(polygon, quantity, [stepRate], [output])

Description:

Returns an array of Point objects containing the coordinates of the points around the perimeter of the Polygon, based on the given quantity or stepRate values.

Parameters:

name type arguments description
polygon Phaser.Geom.Polygon

The Polygon to get the points from.

quantity number

The amount of points to return. If a falsey value the quantity will be derived from the stepRate instead.

stepRate number <optional>

Sets the quantity by getting the perimeter of the Polygon and dividing it by the stepRate.

output array <optional>

An array to insert the points in to. If not provided a new array will be created.

Returns:
Description:

An array of Point objects pertaining to the points around the perimeter of the Polygon.

Type:
Since: 3.12.0