mirror of
https://github.com/photonstorm/phaser
synced 2024-12-18 17:16:03 +00:00
1 line
No EOL
21 KiB
JSON
1 line
No EOL
21 KiB
JSON
{"class":{"name":"Phaser.Point","extends":"","static":false,"constructor":true,"parameters":[{"name":"x","type":["number"],"help":"The horizontal position of this Point.","optional":true,"default":"0"},{"name":"y","type":["number"],"help":"The vertical position of this Point.","optional":true,"default":"0"}],"help":"A Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.\\nThe following code creates a point at (0,0):\\n`var myPoint = new Phaser.Point();`\\nYou can also use them as 2D Vectors and you'll find different vector related methods in this class."},"consts":[],"methods":{"public":[{"name":"add","static":false,"returns":{"types":["Phaser.Point"],"help":"The new Point object."},"help":"Adds the coordinates of two points together to create a new point.","line":483,"public":true,"protected":false,"private":false,"parameters":[{"name":"a","type":["Phaser.Point"],"help":"The first Point object.","optional":false,"default":null},{"name":"b","type":["Phaser.Point"],"help":"The second Point object.","optional":false,"default":null},{"name":"out","type":["Phaser.Point"],"help":"Optional Point to store the value in, if not supplied a new Point object will be created.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"angle","static":false,"returns":{"types":["number"],"help":"The angle between the two Points."},"help":"Returns the angle between two Point objects.","line":576,"public":true,"protected":false,"private":false,"parameters":[{"name":"a","type":["Phaser.Point"],"help":"The first Point object.","optional":false,"default":null},{"name":"b","type":["Phaser.Point"],"help":"The second Point object.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"angleSq","static":false,"returns":{"types":["number"],"help":"The angle squared between the two Points."},"help":"Returns the angle squared between two Point objects.","line":591,"public":true,"protected":false,"private":false,"parameters":[{"name":"a","type":["Phaser.Point"],"help":"The first Point object.","optional":false,"default":null},{"name":"b","type":["Phaser.Point"],"help":"The second Point object.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"centroid","static":false,"returns":{"types":["Phaser.Point"],"help":"The new Point object."},"help":"Calculates centroid (or midpoint) from an array of points. If only one point is provided, that point is returned.","line":834,"public":true,"protected":false,"private":false,"parameters":[{"name":"points","type":["array Phaser.Point"],"help":"The array of one or more points.","optional":false,"default":null},{"name":"out","type":["Phaser.Point"],"help":"Optional Point to store the value in, if not supplied a new Point object will be created.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"clamp","static":false,"returns":{"types":["Phaser.Point"],"help":"This Point object."},"help":"Clamps this Point object values to be between the given min and max.","line":202,"public":true,"protected":false,"private":false,"parameters":[{"name":"min","type":["number"],"help":"The minimum value to clamp this Point to.","optional":false,"default":null},{"name":"max","type":["number"],"help":"The maximum value to clamp this Point to.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"clampX","static":false,"returns":{"types":["Phaser.Point"],"help":"This Point object."},"help":"Clamps the x value of this Point to be between the given min and max.","line":172,"public":true,"protected":false,"private":false,"parameters":[{"name":"min","type":["number"],"help":"The minimum value to clamp this Point to.","optional":false,"default":null},{"name":"max","type":["number"],"help":"The maximum value to clamp this Point to.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"clampY","static":false,"returns":{"types":["Phaser.Point"],"help":"This Point object."},"help":"Clamps the y value of this Point to be between the given min and max","line":187,"public":true,"protected":false,"private":false,"parameters":[{"name":"min","type":["number"],"help":"The minimum value to clamp this Point to.","optional":false,"default":null},{"name":"max","type":["number"],"help":"The maximum value to clamp this Point to.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"clone","static":false,"returns":{"types":["Phaser.Point"],"help":"The new Point object."},"help":"Creates a copy of the given Point.","line":217,"public":true,"protected":false,"private":false,"parameters":[{"name":"output","type":["Phaser.Point"],"help":" Optional Point object. If given the values will be set into this object, otherwise a brand new Point object will be created and returned.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"copyFrom","static":false,"returns":{"types":["Phaser.Point"],"help":"This Point object."},"help":"Copies the x and y properties from any given object to this Point.","line":44,"public":true,"protected":false,"private":false,"parameters":[{"name":"source","type":["any"],"help":"The object to copy from.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"copyTo","static":false,"returns":{"types":["object"],"help":"The dest object."},"help":"Copies the x and y properties from this Point to any given object.","line":239,"public":true,"protected":false,"private":false,"parameters":[{"name":"dest","type":["any"],"help":"The object to copy to.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"cross","static":false,"returns":{"types":["number"],"help":"The result."},"help":"The cross product of this and another Point object.","line":416,"public":true,"protected":false,"private":false,"parameters":[{"name":"a","type":["Phaser.Point"],"help":"The Point object to get the cross product combined with this Point.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"distance","static":false,"returns":{"types":["number"],"help":"The distance between this Point object and the destination Point object."},"help":"Returns the distance of this Point object to the given object (can be a Circle, Point or anything with x\/y properties).","line":690,"public":true,"protected":false,"private":false,"parameters":[{"name":"a","type":["object"],"help":"The target object. Must have visible x and y properties that represent the center of the object.","optional":false,"default":null},{"name":"b","type":["object"],"help":"The target object. Must have visible x and y properties that represent the center of the object.","optional":false,"default":null},{"name":"round","type":["boolean"],"help":"Round the distance to the nearest integer (default false).","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"divide","static":false,"returns":{"types":["Phaser.Point"],"help":"The new Point object."},"help":"Divides the coordinates of two points to create a new point.","line":543,"public":true,"protected":false,"private":false,"parameters":[{"name":"a","type":["Phaser.Point"],"help":"The first Point object.","optional":false,"default":null},{"name":"b","type":["Phaser.Point"],"help":"The second Point object.","optional":false,"default":null},{"name":"out","type":["Phaser.Point"],"help":"Optional Point to store the value in, if not supplied a new Point object will be created.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"dot","static":false,"returns":{"types":["number"],"help":"The result."},"help":"The dot product of this and another Point object.","line":403,"public":true,"protected":false,"private":false,"parameters":[{"name":"a","type":["Phaser.Point"],"help":"The Point object to get the dot product combined with this Point.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"equals","static":false,"returns":{"types":["boolean"],"help":"A value of true if the Points are equal, otherwise false."},"help":"Determines whether the two given Point objects are equal. They are considered equal if they have the same x and y values.","line":562,"public":true,"protected":false,"private":false,"parameters":[{"name":"a","type":["Phaser.Point"],"help":"The first Point object.","optional":false,"default":null},{"name":"b","type":["Phaser.Point"],"help":"The second Point object.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"getMagnitude","static":false,"returns":{"types":["number"],"help":"The length of the Point."},"help":"Calculates the length of the Point object.","line":334,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"getMagnitudeSq","static":false,"returns":{"types":["number"],"help":"The length ^ 2 of the Point."},"help":"Calculates the length squared of the Point object.","line":346,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"interpolate","static":false,"returns":{"types":["Phaser.Point"],"help":"The new Point object."},"help":"Interpolates the two given Points, based on the `f` value (between 0 and 1) and returns a new Point.","line":641,"public":true,"protected":false,"private":false,"parameters":[{"name":"a","type":["Phaser.Point"],"help":"The first Point object.","optional":false,"default":null},{"name":"b","type":["Phaser.Point"],"help":"The second Point object.","optional":false,"default":null},{"name":"f","type":["number"],"help":"The level of interpolation between the two points. Indicates where the new point will be, along the line between pt1 and pt2. If f=1, pt1 is returned; if f=0, pt2 is returned.","optional":false,"default":null},{"name":"out","type":["Phaser.Point"],"help":"Optional Point to store the value in, if not supplied a new Point object will be created.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"invert","static":false,"returns":{"types":["Phaser.Point"],"help":"This Point object."},"help":"Inverts the x and y values of this Point","line":56,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"isZero","static":false,"returns":{"types":["boolean"],"help":"True if this Point is 0,0, otherwise false."},"help":"Determine if this point is at 0,0.","line":390,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"multiply","static":false,"returns":{"types":["Phaser.Point"],"help":"The new Point object."},"help":"Multiplies the coordinates of two points to create a new point.","line":523,"public":true,"protected":false,"private":false,"parameters":[{"name":"a","type":["Phaser.Point"],"help":"The first Point object.","optional":false,"default":null},{"name":"b","type":["Phaser.Point"],"help":"The second Point object.","optional":false,"default":null},{"name":"out","type":["Phaser.Point"],"help":"Optional Point to store the value in, if not supplied a new Point object will be created.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"multiplyAdd","static":false,"returns":{"types":["Phaser.Point"],"help":"The new Point object."},"help":"Adds two 2D Points together and multiplies the result by the given scalar.","line":623,"public":true,"protected":false,"private":false,"parameters":[{"name":"a","type":["Phaser.Point"],"help":"The first Point object.","optional":false,"default":null},{"name":"b","type":["Phaser.Point"],"help":"The second Point object.","optional":false,"default":null},{"name":"s","type":["number"],"help":"The scaling value.","optional":false,"default":null},{"name":"out","type":["Phaser.Point"],"help":"Optional Point to store the value in, if not supplied a new Point object will be created.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"negative","static":false,"returns":{"types":["Phaser.Point"],"help":"The new Point object."},"help":"Creates a negative Point.","line":605,"public":true,"protected":false,"private":false,"parameters":[{"name":"a","type":["Phaser.Point"],"help":"The first Point object.","optional":false,"default":null},{"name":"out","type":["Phaser.Point"],"help":"Optional Point to store the value in, if not supplied a new Point object will be created.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"normalRightHand","static":false,"returns":{"types":["Phaser.Point"],"help":"The new Point object."},"help":"Right-hand normalize (make unit length) a Point.","line":761,"public":true,"protected":false,"private":false,"parameters":[{"name":"a","type":["Phaser.Point"],"help":"The Point object.","optional":false,"default":null},{"name":"out","type":["Phaser.Point"],"help":"Optional Point to store the value in, if not supplied a new Point object will be created.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"normalize","static":false,"returns":{"types":["Phaser.Point"],"help":"The new Point object."},"help":"Normalize (make unit length) a Point.","line":777,"public":true,"protected":false,"private":false,"parameters":[{"name":"a","type":["Phaser.Point"],"help":"The Point object.","optional":false,"default":null},{"name":"out","type":["Phaser.Point"],"help":"Optional Point to store the value in, if not supplied a new Point object will be created.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"parse","static":true,"returns":{"types":["Phaser.Point"],"help":"The new Point object."},"help":"Parses an object for x and\/or y properties and returns a new Phaser.Point with matching values.\\nIf the object doesn't contain those properties a Point with x\/y of zero will be returned.","line":878,"public":true,"protected":false,"private":false,"parameters":[{"name":"obj","type":["object"],"help":"The object to parse.","optional":false,"default":null},{"name":"xProp","type":["string"],"help":"The property used to set the Point.x value.","optional":true,"default":"'x'"},{"name":"yProp","type":["string"],"help":"The property used to set the Point.y value.","optional":true,"default":"'y'"}],"inherited":false,"inheritedFrom":""},{"name":"perp","static":false,"returns":{"types":["Phaser.Point"],"help":"The new Point object."},"help":"Return a perpendicular vector (90 degrees rotation)","line":657,"public":true,"protected":false,"private":false,"parameters":[{"name":"a","type":["Phaser.Point"],"help":"The Point object.","optional":false,"default":null},{"name":"out","type":["Phaser.Point"],"help":"Optional Point to store the value in, if not supplied a new Point object will be created.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"project","static":false,"returns":{"types":["Phaser.Point"],"help":"The new Point object."},"help":"Project two Points onto another Point.","line":714,"public":true,"protected":false,"private":false,"parameters":[{"name":"a","type":["Phaser.Point"],"help":"The first Point object.","optional":false,"default":null},{"name":"b","type":["Phaser.Point"],"help":"The second Point object.","optional":false,"default":null},{"name":"out","type":["Phaser.Point"],"help":"Optional Point to store the value in, if not supplied a new Point object will be created.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"projectUnit","static":false,"returns":{"types":["Phaser.Point"],"help":"The new Point object."},"help":"Project two Points onto a Point of unit length.","line":738,"public":true,"protected":false,"private":false,"parameters":[{"name":"a","type":["Phaser.Point"],"help":"The first Point object.","optional":false,"default":null},{"name":"b","type":["Phaser.Point"],"help":"The second Point object.","optional":false,"default":null},{"name":"out","type":["Phaser.Point"],"help":"Optional Point to store the value in, if not supplied a new Point object will be created.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"rotate","static":false,"returns":{"types":["Phaser.Point"],"help":"The modified point object."},"help":"Rotates a Point around the x\/y coordinates given to the desired angle.","line":804,"public":true,"protected":false,"private":false,"parameters":[{"name":"a","type":["Phaser.Point"],"help":"The Point object to rotate.","optional":false,"default":null},{"name":"x","type":["number"],"help":"The x coordinate of the anchor point","optional":false,"default":null},{"name":"y","type":["number"],"help":"The y coordinate of the anchor point","optional":false,"default":null},{"name":"angle","type":["number"],"help":"The angle in radians (unless asDegrees is true) to rotate the Point to.","optional":false,"default":null},{"name":"asDegrees","type":["boolean"],"help":"Is the given rotation in radians (false) or degrees (true)?","optional":true,"default":"false"},{"name":"distance","type":["number"],"help":"An optional distance constraint between the Point and the anchor.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"rperp","static":false,"returns":{"types":["Phaser.Point"],"help":"The new Point object."},"help":"Return a perpendicular vector (-90 degrees rotation)","line":673,"public":true,"protected":false,"private":false,"parameters":[{"name":"a","type":["Phaser.Point"],"help":"The Point object.","optional":false,"default":null},{"name":"out","type":["Phaser.Point"],"help":"Optional Point to store the value in, if not supplied a new Point object will be created.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"set","static":false,"returns":{"types":["Phaser.Point"],"help":"This Point object. Useful for chaining method calls."},"help":"Sets the `x` and `y` values of this Point object to the given values.\\nIf you omit the `y` value then the `x` value will be applied to both, for example:\\n`Point.setTo(2)` is the same as `Point.setTo(2, 2)`","line":91,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"The horizontal value of this point.","optional":false,"default":null},{"name":"y","type":["number"],"help":"The vertical value of this point. If not given the x value will be used in its place.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"setMagnitude","static":false,"returns":{"types":["Phaser.Point"],"help":"This Point object."},"help":"Alters the length of the Point without changing the direction.","line":359,"public":true,"protected":false,"private":false,"parameters":[{"name":"magnitude","type":["number"],"help":"The desired magnitude of the resulting Point.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"setTo","static":false,"returns":{"types":["Phaser.Point"],"help":"This Point object. Useful for chaining method calls."},"help":"Sets the `x` and `y` values of this Point object to the given values.\\nIf you omit the `y` value then the `x` value will be applied to both, for example:\\n`Point.setTo(2)` is the same as `Point.setTo(2, 2)`","line":72,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"The horizontal value of this point.","optional":false,"default":null},{"name":"y","type":["number"],"help":"The vertical value of this point. If not given the x value will be used in its place.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"subtract","static":false,"returns":{"types":["Phaser.Point"],"help":"The new Point object."},"help":"Subtracts the coordinates of two points to create a new point.","line":503,"public":true,"protected":false,"private":false,"parameters":[{"name":"a","type":["Phaser.Point"],"help":"The first Point object.","optional":false,"default":null},{"name":"b","type":["Phaser.Point"],"help":"The second Point object.","optional":false,"default":null},{"name":"out","type":["Phaser.Point"],"help":"Optional Point to store the value in, if not supplied a new Point object will be created.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"toString","static":false,"returns":{"types":["string"],"help":"A string representation of the instance."},"help":"Returns a string representation of this object.","line":464,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""}],"protected":[],"private":[],"static":[]},"properties":{"public":[{"name":"x","type":["number"],"help":"","inlineHelp":"The x value of the point.","line":26,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"y","type":["number"],"help":"","inlineHelp":"The y value of the point.","line":31,"default":null,"public":true,"protected":false,"private":false,"readOnly":false}],"protected":[],"private":[]}} |