Phaser API Documentation

  Version: 

Member of: Phaser.Geom.Polygon

getPoints(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
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 | Array.<Phaser.Geom.Point> <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:
Examples:
Since: 3.12.0