Phaser API Documentation

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


Calculates a list of evenly distributed points on the triangle. It is either possible to pass an amount of points to be generated (quantity) or the distance between two points (stepRate).


name type arguments description
quantity number

Number of points to be generated. Can be falsey when stepRate should be used. All points have the same distance along the triangle.

stepRate number <optional>

Distance between two points. Will only be used when quantity is falsey.

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

Optional Array for writing the calculated points into. Otherwise a new array will be created.


Returns a list of calculated Point instances or the filled array passed as parameter output.

Since: 3.0.0