Line#rotate()

rotate(angle, asDegrees) → {Phaser.Line} Rotates the line by the amount specified in angle. Rotation takes place from the center of the line.If you wish to rotate around a different point see Line.rotateAround. If you wish to rotate the ends of the Line then see Line.start.rotate or Line.end.rotate. Parameters Name Type Argument Default Description angle number The angle in radians (unless asDegrees is true) to rotate the line by. asDegrees boolean <optional> false Is the gi

Line#right

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

Line#reflect()

reflect(line) → {number} Returns the reflected angle between two lines.This is the outgoing angle based on the angle of this line and the normalAngle of the given line. Parameters Name Type Description line Phaser.Line The line to reflect off this line. Returns number - The reflected angle in radians. Source code: geom/Line.js (Line 168)

Line#random()

random(out) → {Phaser.Point} Picks a random point from anywhere on the Line segment and returns it. Parameters Name Type Argument Description out Phaser.Point | object <optional> A Phaser.Point, or any object with public x/y properties, that the values will be set in. If no object is provided a new Phaser.Point object will be created. In high performance areas avoid this by re-using an object. Returns Phaser.Point - An object containing the random point in its x and y properti

Line#pointOnSegment()

pointOnSegment(x, y) → {boolean} Tests if the given coordinates fall on this line and within the segment. See pointOnLine to test against just the line. Parameters Name Type Description x number The line to check against this one. y number The line to check against this one. Returns boolean - True if the point is on the line and segment, false if not. Source code: geom/Line.js (Line 238)

Line#pointOnLine()

pointOnLine(x, y) → {boolean} Tests if the given coordinates fall on this line. See pointOnSegment to test against just the line segment. Parameters Name Type Description x number The line to check against this one. y number The line to check against this one. Returns boolean - True if the point is on the line, false if not. Source code: geom/Line.js (Line 224)

Line#perpSlope

[readonly] perpSlope : number Gets the perpendicular slope of the line (x/y). Source code: geom/Line.js (Line 398)

Line#normalY

[readonly] normalY : number Gets the y component of the left-hand normal of this line. Source code: geom/Line.js (Line 528)

Line#normalX

[readonly] normalX : number Gets the x component of the left-hand normal of this line. Source code: geom/Line.js (Line 515)

Line#normalAngle

[readonly] normalAngle : number Gets the angle in radians of the normal of this line (line.angle - 90 degrees.) Source code: geom/Line.js (Line 541)