mirror of
https://github.com/photonstorm/phaser
synced 2024-12-21 02:23:29 +00:00
1 line
No EOL
9.9 KiB
JSON
1 line
No EOL
9.9 KiB
JSON
{"class":{"name":"Phaser.Line","extends":"","static":false,"constructor":true,"parameters":[{"name":"x1","type":["number"],"help":"The x coordinate of the start of the line.","optional":true,"default":"0"},{"name":"y1","type":["number"],"help":"The y coordinate of the start of the line.","optional":true,"default":"0"},{"name":"x2","type":["number"],"help":"The x coordinate of the end of the line.","optional":true,"default":"0"},{"name":"y2","type":["number"],"help":"The y coordinate of the end of the line.","optional":true,"default":"0"}],"help":"Creates a new Line object with a start and an end point."},"consts":[],"methods":{"public":[{"name":"clone","static":false,"returns":{"types":["Phaser.Line"],"help":"The cloned Line object."},"help":"Returns a new Line object with the same values for the start and end properties as this Line object.","line":190,"public":true,"protected":false,"private":false,"parameters":[{"name":"output","type":["Phaser.Line"],"help":"Optional Line object. If given the values will be set into the object, otherwise a brand new Line object will be created and returned.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"coordinatesOnLine","static":false,"returns":{"types":["array"],"help":"An array of coordinates."},"help":"Using Bresenham's line algorithm this will return an array of all coordinates on this line.\\nThe start and end points are rounded before this runs as the algorithm works on integers.","line":135,"public":true,"protected":false,"private":false,"parameters":[{"name":"stepRate","type":["number"],"help":"How many steps will we return? 1 = every coordinate on the line, 2 = every other coordinate, etc.","optional":true,"default":"1"},{"name":"results","type":["array"],"help":"The array to store the results in. If not provided a new one will be generated.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"fromSprite","static":false,"returns":{"types":["Phaser.Line"],"help":"This line object"},"help":"Sets the line to match the x\/y coordinates of the two given sprites.\\nCan optionally be calculated from their center coordinates.","line":65,"public":true,"protected":false,"private":false,"parameters":[{"name":"startSprite","type":["Phaser.Sprite"],"help":"The coordinates of this Sprite will be set to the Line.start point.","optional":false,"default":null},{"name":"endSprite","type":["Phaser.Sprite"],"help":"The coordinates of this Sprite will be set to the Line.start point.","optional":false,"default":null},{"name":"useCenter","type":["boolean"],"help":"If true it will use startSprite.center.x, if false startSprite.x. Note that Sprites don't have a center property by default, so only enable if you've over-ridden your Sprite with a custom class.","optional":true,"default":"false"}],"inherited":false,"inheritedFrom":""},{"name":"intersects","static":false,"returns":{"types":["Phaser.Point"],"help":"The intersection segment of the two lines as a Point, or null if there is no intersection."},"help":"Checks for intersection between two lines.\\nIf asSegment is true it will check for segment intersection.\\nIf asSegment is false it will check for line intersection.\\nReturns the intersection segment of AB and EF as a Point, or null if there is no intersection.\\nAdapted from code by Keith Hair","line":429,"public":true,"protected":false,"private":false,"parameters":[{"name":"a","type":["Phaser.Line"],"help":"The first Line to be checked.","optional":false,"default":null},{"name":"b","type":["Phaser.Line"],"help":"The second Line to be checked.","optional":false,"default":null},{"name":"asSegment","type":["boolean"],"help":"If true it will check for segment intersection, otherwise full line intersection.","optional":true,"default":"true"},{"name":"result","type":["Phaser.Point"],"help":"A Point object to store the result in, if not given a new one will be created.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"intersectsPoints","static":false,"returns":{"types":["Phaser.Point"],"help":"The intersection segment of the two lines as a Point, or null if there is no intersection."},"help":"Checks for intersection between two lines as defined by the given start and end points.\\nIf asSegment is true it will check for line segment intersection. If asSegment is false it will check for line intersection.\\nReturns the intersection segment of AB and EF as a Point, or null if there is no intersection.\\nAdapted from code by Keith Hair","line":378,"public":true,"protected":false,"private":false,"parameters":[{"name":"a","type":["Phaser.Point"],"help":"The start of the first Line to be checked.","optional":false,"default":null},{"name":"b","type":["Phaser.Point"],"help":"The end of the first line to be checked.","optional":false,"default":null},{"name":"e","type":["Phaser.Point"],"help":"The start of the second Line to be checked.","optional":false,"default":null},{"name":"f","type":["Phaser.Point"],"help":"The end of the second line to be checked.","optional":false,"default":null},{"name":"asSegment","type":["boolean"],"help":"If true it will check for segment intersection, otherwise full line intersection.","optional":true,"default":"true"},{"name":"result","type":["Phaser.Point"],"help":"A Point object to store the result in, if not given a new one will be created.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"pointOnLine","static":false,"returns":{"types":["boolean"],"help":"True if the point is on the line, false if not."},"help":"Tests if the given coordinates fall on this line. See pointOnSegment to test against just the line segment.","line":102,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"The line to check against this one.","optional":false,"default":null},{"name":"y","type":["number"],"help":"The line to check against this one.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"pointOnSegment","static":false,"returns":{"types":["boolean"],"help":"True if the point is on the line and segment, false if not."},"help":"Tests if the given coordinates fall on this line and within the segment. See pointOnLine to test against just the line.","line":115,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"The line to check against this one.","optional":false,"default":null},{"name":"y","type":["number"],"help":"The line to check against this one.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"setTo","static":false,"returns":{"types":["Phaser.Line"],"help":"This line object"},"help":"Sets the components of the Line to the specified values.","line":47,"public":true,"protected":false,"private":false,"parameters":[{"name":"x1","type":["number"],"help":"The x coordinate of the start of the line.","optional":true,"default":"0"},{"name":"y1","type":["number"],"help":"The y coordinate of the start of the line.","optional":true,"default":"0"},{"name":"x2","type":["number"],"help":"The x coordinate of the end of the line.","optional":true,"default":"0"},{"name":"y2","type":["number"],"help":"The y coordinate of the end of the line.","optional":true,"default":"0"}],"inherited":false,"inheritedFrom":""}],"protected":[],"private":[],"static":[]},"properties":{"public":[{"name":"angle","type":["number"],"help":"","inlineHelp":"Gets the angle of the line.","line":225,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"bottom","type":["number"],"help":"","inlineHelp":"Gets the bottom-most point of this line.","line":329,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"end","type":["Phaser.Point"],"help":"","inlineHelp":"The end point of the line.","line":32,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"height","type":["number"],"help":"","inlineHelp":"Gets the height of this bounds of this line.","line":355,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"left","type":["number"],"help":"","inlineHelp":"Gets the left-most point of this line.","line":290,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"length","type":["number"],"help":"","inlineHelp":"Gets the length of the line segment.","line":212,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"perpSlope","type":["number"],"help":"","inlineHelp":"Gets the perpendicular slope of the line (x\/y).","line":251,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"right","type":["number"],"help":"","inlineHelp":"Gets the right-most point of this line.","line":303,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"slope","type":["number"],"help":"","inlineHelp":"Gets the slope of the line (y\/x).","line":238,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"start","type":["Phaser.Point"],"help":"","inlineHelp":"The start point of the line.","line":27,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"top","type":["number"],"help":"","inlineHelp":"Gets the top-most point of this line.","line":316,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"width","type":["number"],"help":"","inlineHelp":"Gets the width of this bounds of this line.","line":342,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"x","type":["number"],"help":"","inlineHelp":"Gets the x coordinate of the top left of the bounds around this line.","line":264,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"y","type":["number"],"help":"","inlineHelp":"Gets the y coordinate of the top left of the bounds around this line.","line":277,"default":null,"public":true,"protected":false,"private":false,"readOnly":true}],"protected":[],"private":[]}} |