Stores a 2D floating point coordinate.
Static variables
Static methods
Constructor
Variables
Methods
inlineadd(X:Float = 0, Y:Float = 0):FlxPoint
Adds to the coordinates of this point.
Parameters:
X | Amount to add to x |
---|---|
Y | Amount to add to y |
Returns:
This point.
addPoint(point:FlxPoint):FlxPoint
Adds the coordinates of another point to the coordinates of this point.
Parameters:
point | The point to add to this point |
---|
Returns:
This point.
inlineaddToFlash(FlashPoint:Point):Point
Helper function, just increases the values of the specified Flash point by the values of this point.
Parameters:
Point | Any Point. |
---|
Returns:
A reference to the altered point parameter.
angleBetween(point:FlxPoint):Float
Calculates the angle between this and another point. 0 degrees points straight up.
Parameters:
point | The other point. |
---|
Returns:
The angle in degrees, between -180 and 180.
inlinecopyFrom(point:FlxPoint):FlxPoint
Helper function, just copies the values from the specified point.
Parameters:
point | Any FlxPoint. |
---|
Returns:
A reference to itself.
inlinecopyFromFlash(FlashPoint:Point):FlxPoint
Helper function, just copies the values from the specified Flash point.
Parameters:
Point | Any Point. |
---|
Returns:
A reference to itself.
copyTo(?point:FlxPoint):FlxPoint
Helper function, just copies the values from this point to the specified point.
Parameters:
Point | Any FlxPoint. |
---|
Returns:
A reference to the altered point parameter.
inlinecopyToFlash(FlashPoint:Point):Point
Helper function, just copies the values from this point to the specified Flash point.
Parameters:
Point | Any Point. |
---|
Returns:
A reference to the altered point parameter.
distanceTo(point:FlxPoint):Float
Calculate the distance to another point.
Parameters:
AnotherPoint | A FlxPoint object to calculate the distance to. |
---|
Returns:
The distance between the two points as a Float.
inlineequals(point:FlxPoint):Bool
Function to compare this FlxPoint to another.
Parameters:
point | The other FlxPoint to compare to this one. |
---|
Returns:
True if the FlxPoints have the same x and y value, false otherwise.
inlineinCoords(RectX:Float, RectY:Float, RectWidth:Float, RectHeight:Float):Bool
Returns true if this point is within the given rectangular block
Parameters:
RectX | The X value of the region to test within |
---|---|
RectY | The Y value of the region to test within |
RectWidth | The width of the region to test within |
RectHeight | The height of the region to test within |
Returns:
True if the point is within the region, otherwise false
inlineinRect(Rect:FlxRect):Bool
Returns true if this point is within the given rectangular block
Parameters:
Rect | The FlxRect to test within |
---|
Returns:
True if pointX/pointY is within the FlxRect, otherwise false
inlineputWeak():Void
Add this FlxPoint to the recycling pool if it's a weak reference (allocated via weak()).
rotate(Pivot:FlxPoint, Angle:Float):FlxPoint
Rotates this point clockwise in 2D space around another point by the given angle.
Parameters:
Pivot | The pivot you want to rotate this point around |
---|---|
Angle | Rotate the point by this many degrees clockwise. |
Returns:
A FlxPoint containing the coordinates of the rotated point.
scale(k:Float):FlxPoint
Scale this point.
Parameters:
k |
|
---|
Returns:
scaled point
4.1.0
.set(X:Float = 0, Y:Float = 0):FlxPoint
Set the coordinates of this point.
Parameters:
X | The X-coordinate of the point in space. |
---|---|
Y | The Y-coordinate of the point in space. |
Returns:
This point.
inlinesubtract(X:Float = 0, Y:Float = 0):FlxPoint
Subtracts from the coordinates of this point.
Parameters:
X | Amount to subtract from x |
---|---|
Y | Amount to subtract from y |
Returns:
This point.
inlinesubtractFromFlash(FlashPoint:Point):Point
Helper function, just decreases the values of the specified Flash point by the values of this point.
Parameters:
Point | Any Point. |
---|
Returns:
A reference to the altered point parameter.
subtractPoint(point:FlxPoint):FlxPoint
Subtracts the coordinates of another point from the coordinates of this point.
Parameters:
point | The point to subtract from this point |
---|
Returns:
This point.
inlinetoString():String
Convert object to readable string name. Useful for debugging, save games, etc.