class flixel.util.FlxRect implements IFlxPooled
Available on all platforms
Sub classes | ||||
![]() | FlxQuadTree |
|
Stores a rectangle.
Class Fields
static function get(?X:Float = 0, ?Y:Float = 0, ?Width:Float = 0, ?Height:Float = 0):FlxRect
Recycle or create new FlxRect. * 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. |
Instance Fields
function containsFlxPoint(Point:FlxPoint):Bool
Returns true if this FlxRect contains the FlxPoint * *
Point | The FlxPoint to check * |
returns | True if the FlxPoint is within this FlxRect, otherwise false |
function copyFrom(Rect:FlxRect):FlxRect
Helper function, just copies the values from the specified rectangle. * *
Rect | Any FlxRect. * |
returns | A reference to itself. |
function copyFromFlash(FlashRect:Rectangle):FlxRect
Helper function, just copies the values from the specified Flash rectangle. * *
FlashRect | Any Rectangle. * |
returns | A reference to itself. |
function copyTo(Rect:FlxRect):FlxRect
Helper function, just copies the values from this rectangle to the specified rectangle. * *
Point | Any FlxRect. * |
returns | A reference to the altered rectangle parameter. |
function copyToFlash(FlashRect:Rectangle):Rectangle
Helper function, just copies the values from this rectangle to the specified Flash rectangle. * *
Point | Any Rectangle. * |
returns | A reference to the altered rectangle parameter. |
function overlaps(Rect:FlxRect):Bool
Checks to see if some FlxRect object overlaps this FlxRect object. * *
Rect | The rectangle being tested. * |
returns | Whether or not the two rectangles overlap. |
function set(?X:Float = 0, ?Y:Float = 0, ?Width:Float = 0, ?Height:Float = 0):FlxRect
Fill this rectangle with the data provided. * *
X | The X-coordinate of the point in space. * |
Y | The Y-coordinate of the point in space. * |
Width | Desired width of the rectangle. * |
Height | Desired height of the rectangle. * |
returns | A reference to itself. |
function setSize(Width:Float, Height:Float):FlxRect
Shortcut for setting both width and Height. * *
Width | The new sprite width. * |
Height | The new sprite height. |