Phaser API Documentation

<static> GetPoints(rectangle, step, quantity, [out])


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


name type arguments description
rectangle Phaser.Geom.Rectangle

The Rectangle object to get the points from.

step number

Step between points. Used to calculate the number of points to return when quantity is falsey. Ignored if quantity is positive.

quantity number

The number of evenly spaced points from the rectangles perimeter to return. If falsey, step param will be used to calculate the number of points.

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

An optional array to store the points in.


An array of Points from the perimeter of the rectangle.

Since: 3.0.0