Phaser API Documentation

  Version: 
getPoints(quantity, [stepRate], [output])

Description:

Returns an array of points from the perimeter of the Rectangle, each spaced out based on the quantity or step required.

Parameters:

name type arguments description
quantity number

The number of points to return. Set to false or 0 to return an arbitrary number of points (perimeter / stepRate) evenly spaced around the Rectangle based on the stepRate.

stepRate number <optional>

If quantity is 0, determines the normalized distance between each returned point.

output array | Array.<Phaser.Geom.Point> <optional>

An array to which to append the points.

Returns:
Description:

The modified output array, or a new array if none was provided.

Type:
Since: 3.0.0