Phaser API Documentation

  Version: 

Member of: Phaser.Geom.Line

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

Description:

Get a number of points along a line's length.

Provide a quantity to get an exact number of points along the line.

Provide a stepRate to ensure a specific distance between each point on the line. Set quantity to 0 when providing a stepRate.

Parameters:

name type arguments description
quantity number

The number of points to place on the line. Set to 0 to use stepRate instead.

stepRate number <optional>

The distance between each point on the line. When set, quantity is implied and should be set to 0.

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

An optional array of Points, or point-like objects, to store the coordinates of the points on the line.

Returns:
Description:

An array of Points, or point-like objects, containing the coordinates of the points on the line.

Type:
Since: 3.0.0
Source: src/geom/line/Line.js (Line 105)