Static methods
staticinlineget(x:Float = 0, y:Float = 0, width:Float = 1, height:Float = 0, rotation:Float = 0, scale_x:Float = 1, scale_y:Float = 1):Rect
Gets a Rect from the pool, or creates a new one if none are available. Call put()
on the Rect to place it back in the pool.
Note - The X and Y positions represent the center of the Rect. To set the Rect from its Top-Left origin, Rect.get_from_min_max()
is available.
Parameters:
x | The centered X position of the Rect. |
---|---|
y | The centered Y position of the Rect. |
width | The width of the Rect. |
height | The height of the Rect. |
rotation | The rotation of the Rect. |
Returns:
Rect
Variables
ex:Float
The half-width of the Rectangle, transformed with scale_x
. Use local_ex
to get the untransformed extent.
ey:Float
The half-height of the Rectangle, transformed with scale_y
. Use local_ey
to get the untransformed extent.
height:Float
The height of the Rectangle, transformed with scale_y
. Use local_height
to get the untransformed height.
read onlytransformed_rect:Null<Polygon>
If the Rectangle has a rotation, this Polygon is constructed to represent the transformed vertices of the Rectangle.