Line#midPoint()

midPoint(out) → {Phaser.Point} Returns a Point object where the x and y values correspond to the center (or midpoint) of the Line segment. Parameters Name Type Argument Description out Phaser.Point <optional> A Phaser.Point object into which the result will be populated. If not given a new Point object is created. Returns Phaser.Point - A Phaser.Point object with the x and y values set to the center of the line segment. Source code: geom/Line.js (Line 182)

Line#Line

new Line(x1, y1, x2, y2) Creates a new Line object with a start and an end point. Parameters Name Type Argument Default Description x1 number <optional> 0 The x coordinate of the start of the line. y1 number <optional> 0 The y coordinate of the start of the line. x2 number <optional> 0 The x coordinate of the end of the line. y2 number <optional> 0 The y coordinate of the end of the line. Source code: geom/Line.js (Line 17)

Line#length

[readonly] length : number Gets the length of the line segment. Source code: geom/Line.js (Line 359)

Line#left

[readonly] left : number Gets the left-most point of this line. Source code: geom/Line.js (Line 437)

Line#intersects()

intersects(line, asSegment, result) → {Phaser.Point} Checks for intersection between this line and another Line.If asSegment is true it will check for segment intersection. If asSegment is false it will check for line intersection.Returns the intersection segment of AB and EF as a Point, or null if there is no intersection. Parameters Name Type Argument Default Description line Phaser.Line The line to check against this one. asSegment boolean <optional> true If true it will

Line#height

[readonly] height : number Gets the height of this bounds of this line. Source code: geom/Line.js (Line 502)

Line#fromSprite()

fromSprite(startSprite, endSprite, useCenter) → {Phaser.Line} Sets the line to match the x/y coordinates of the two given sprites.Can optionally be calculated from their center coordinates. Parameters Name Type Argument Default Description startSprite Phaser.Sprite The coordinates of this Sprite will be set to the Line.start point. endSprite Phaser.Sprite The coordinates of this Sprite will be set to the Line.start point. useCenter boolean <optional> false If true it w

Line#fromAngle()

fromAngle(x, y, angle, length) → {Phaser.Line} Sets this line to start at the given x and y coordinates and for the segment to extend at angle for the given length. Parameters Name Type Description x number The x coordinate of the start of the line. y number The y coordinate of the start of the line. angle number The angle of the line in radians. length number The length of the line in pixels. Returns Phaser.Line - This line object Source code: geom/Line.js (Line 86)

Line#end

end : Phaser.Point The end point of the line. Source code: geom/Line.js (Line 32)

Line#coordinatesOnLine()

coordinatesOnLine(stepRate, results) → {array} 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 Argument Default Description stepRate number <optional> 1 How many steps will we return? 1 = every coordinate on the line, 2 = every other coordinate, etc. results array <optional> The array to store the results in. If not pr