Phaser API Documentation


Member of: Phaser.Geom.Line

<static> BresenhamPoints(line, [stepRate], [results])


Using Bresenham's line algorithm this will return an array of all coordinates on this line.

The start and end points are rounded before this runs as the algorithm works on integers.


name type arguments Default description
line Phaser.Geom.Line

The line.

stepRate number <optional> 1

The optional step rate for the points on the line.

results Array.<Phaser.Types.Math.Vector2Like> <optional>

An optional array to push the resulting coordinates into.


The array of coordinates on the line.

Since: 3.0.0