Stores a rectangle.
Static variables
Static methods
Constructor
Variables
Methods
inlinecontainsPoint(point:FlxPoint):Bool
Returns true if this FlxRect contains the FlxPoint
Parameters:
point | The FlxPoint to check |
---|
Returns:
True if the FlxPoint is within this FlxRect, otherwise false
inlinecontainsXY(xPos:Float, yPos:Float):Bool
Returns true if this FlxRect contains the FlxPoint
Parameters:
xPos | The x position to check |
---|---|
yPos | The y position to check |
Returns:
True if the FlxPoint is within this FlxRect, otherwise false
inlinecopyFrom(Rect:FlxRect):FlxRect
Helper function, just copies the values from the specified rectangle.
Parameters:
Rect | Any FlxRect. |
---|
Returns:
A reference to itself.
inlinecopyFromFlash(FlashRect:Rectangle):FlxRect
Helper function, just copies the values from the specified Flash rectangle.
Parameters:
FlashRect | Any Rectangle. |
---|
Returns:
A reference to itself.
inlinecopyTo(Rect:FlxRect):FlxRect
Helper function, just copies the values from this rectangle to the specified rectangle.
Parameters:
Point | Any FlxRect. |
---|
Returns:
A reference to the altered rectangle parameter.
inlinecopyToFlash(?FlashRect:Null<Rectangle>):Rectangle
Helper function, just copies the values from this rectangle to the specified Flash rectangle.
Parameters:
Point | Any Rectangle. |
---|
Returns:
A reference to the altered rectangle parameter.
inlineequals(rect:FlxRect):Bool
Checks if this rectangle's properties are equal to properties of provided rect.
Parameters:
rect | Rectangle to check equality to. |
---|
Returns:
Whether both rectangles are equal.
inlinefromTwoPoints(Point1:FlxPoint, Point2:FlxPoint):FlxRect
Calculation of bounding box for two points
Parameters:
point1 | first point to calculate bounding box |
---|---|
point2 | second point to calculate bounding box |
Returns:
this rectangle filled with the position and size of bounding box for two specified points
getRotatedBounds(degrees:Float, ?origin:FlxPoint, ?newRect:FlxRect):FlxRect
Calculates the globally aligned bounding box of a FlxRect
with the given angle and origin.
Parameters:
degrees | The rotation, in degrees of the rect. |
---|---|
origin | The relative pivot point, or the point that the rectangle rotates around.
if |
newRect | Optional output |
Returns:
A globally aligned FlxRect
that fully contains the input rectangle.
4.11.0
.intersection(rect:FlxRect, ?result:FlxRect):FlxRect
Returns the area of intersection with specified rectangle. If the rectangles do not intersect, this method returns an empty rectangle.
Parameters:
rect | Rectangle to check intersection against. |
---|
Returns:
The area of intersection of two rectangles.
inlineoverlaps(Rect:FlxRect):Bool
Checks to see if some FlxRect object overlaps this FlxRect object.
Parameters:
Rect | The rectangle being tested. |
---|
Returns:
Whether or not the two rectangles overlap.
inlineputWeak():Void
Add this FlxRect to the recycling pool if it's a weak reference (allocated via weak()).
inlineset(X:Float = 0, Y:Float = 0, Width:Float = 0, Height:Float = 0):FlxRect
Fill this rectangle with the data provided.
Parameters:
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.
inlinesetSize(Width:Float, Height:Float):FlxRect
Shortcut for setting both width and Height.
Parameters:
Width | The new sprite width. |
---|---|
Height | The new sprite height. |
inlinetoString():String
Convert object to readable string name. Useful for debugging, save games, etc.
inlineunion(Rect:FlxRect):FlxRect
Add another rectangle to this one by filling in the horizontal and vertical space between the two rectangles.
Parameters:
Rect | The second FlxRect to add to this one |
---|
Returns:
The changed FlxRect
inlineunionWithPoint(Point:FlxPoint):FlxRect
Add another point to this rectangle one by filling in the horizontal and vertical space between the point and this rectangle.
Parameters:
Point | point to add to this one |
---|
Returns:
The changed FlxRect