class flixel.util.FlxPoint implements IFlxPooled
Available on all platforms
Sub classes | ||||||||||||
![]() | FlxMouse, FlxTouch, MouseRecord, FlxCallbackPoint, FlxVector |
|
Stores a 2D floating point coordinate.
Class Fields
static function get(?X:Float = 0, ?Y:Float = 0):FlxPoint
Recycle or create a new FlxPoint. * Be sure to put() them back into the pool after you're done with them! * *
X | The X-coordinate of the point in space. * |
Y | The Y-coordinate of the point in space. * |
returns | This point. |
static function weak(?X:Float = 0, ?Y:Float = 0):FlxPoint
Recycle or create a new FlxPoint which will automatically be released * to the pool when passed into a flixel function. * *
X | The X-coordinate of the point in space. * |
Y | The Y-coordinate of the point in space. * |
returns | This point. |
Instance Fields
function add(?X:Float = 0, ?Y:Float = 0):FlxPoint
Adds the to the coordinates of this point. * *
X | Amount to add to x * |
Y | Amount to add to y * |
returns | This point. |
function addPoint(point:FlxPoint):FlxPoint
Adds the coordinates of another point to the coordinates of this point. * *
point | The point to add to this point * |
returns | This point. |
function copyFrom(point:FlxPoint):FlxPoint
Helper function, just copies the values from the specified point. * *
point | Any FlxPoint. * |
returns | A reference to itself. |
function copyFromFlash(FlashPoint:Point):FlxPoint
Helper function, just copies the values from the specified Flash point. * *
Point | Any Point. * |
returns | A reference to itself. |
function copyTo(?point:FlxPoint = null):FlxPoint
Helper function, just copies the values from this point to the specified point. * *
Point | Any FlxPoint. * |
returns | A reference to the altered point parameter. |
function copyToFlash(FlashPoint:Point):Point
Helper function, just copies the values from this point to the specified Flash point. * *
Point | Any Point. * |
returns | A reference to the altered point parameter. |
function distanceTo(AnotherPoint:FlxPoint):Float
Calculate the distance to another point. * *
AnotherPoint | A FlxPoint object to calculate the distance to. * |
returns | The distance between the two points as a Float. |
function inCoords(RectX:Float, RectY:Float, RectWidth:Float, RectHeight:Float):Bool
Returns true if this point is within the given rectangular block * *
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 |
function inFlxRect(Rect:FlxRect):Bool
Returns true if this point is within the given rectangular block * *
Rect | The FlxRect to test within * |
returns | True if pointX/pointY is within the FlxRect, otherwise false |
function set(?X:Float = 0, ?Y:Float = 0):FlxPoint
Set the coordinates of this point. * *
X | The X-coordinate of the point in space. * |
Y | The Y-coordinate of the point in space. * |
returns | This point. |
function subtract(?X:Float = 0, ?Y:Float = 0):FlxPoint
Adds the to the coordinates of this point. * *
X | Amount to subtract from x * |
Y | Amount to subtract from y * |
returns | This point. |
function subtractPoint(point:FlxPoint):FlxPoint
Adds the coordinates of another point to the coordinates of this point. * *
point | The point to subtract from this point * |
returns | This point. |