Phaser API Documentation

  Version: 

Member of: Phaser.Geom.Line

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

Description:

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.

Parameters:

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.

Returns:
Description:

The array of coordinates on the line.

Since: 3.0.0