Phaser API Documentation

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


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


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.


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

Since: 3.0.0