Phaser API Documentation


Member of: Phaser.Curves.Curve

getPoints([divisions], [stepRate], [out])


Get a sequence of evenly spaced points from the curve.

You can pass divisions, stepRate, or neither.

The number of divisions will be

  1. divisions, if divisions > 0; or
  2. this.getLength / stepRate, if stepRate > 0; or
  3. this.defaultDivisions

1 + divisions points will be returned.


name type arguments description
divisions number <optional>

The number of divisions to make.

stepRate number <optional>

The curve distance between points, implying divisions.

out array | Array.<Phaser.Math.Vector2> <optional>

An optional array to store the points in.


An array of Points from the curve.

Since: 3.0.0
Source: src/curves/Curve.js (Line 300)