Phaser API Documentation

<static> MarchingAnts(rect, [step], [quantity], [out])


Returns an array of points from the perimeter of the Rectangle, where each point is spaced out based on either the step value, or the quantity.


name type arguments description
rect Phaser.Geom.Rectangle

The Rectangle to get the perimeter points from.

step number <optional>

The distance between each point of the perimeter. Set to null if you wish to use the quantity parameter instead.

quantity number <optional>

The total number of points to return. The step is then calculated based on the length of the Rectangle, divided by this value.

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

An array in which the perimeter points will be stored. If not given, a new array instance is created.


An array containing the perimeter points from the Rectangle.

Since: 3.0.0