Rect
Properties
bl : Vec2 (Read-Only)
br : Vec2 (Read-Only)
origin : Vec2 (Read-Only)
ox : float (Read-Only)
oy : float (Read-Only)
pos : Vec2
size : Vec2
tl : Vec2 (Read-Only)
tr : Vec2 (Read-Only)
x0 : float
x1 : float
y0 : float
y1 : float
Constructors
__init__(self)
__init__(self, other: Rect)
Copy constructor for Rect
__init__(self, pos: Vec2, size: Vec2)
__init__(self, x: float, y: float, w: float, h: float)
Methods
canonicalise(self) -> Rect
container(self, r: Rect) -> Rect
expand(self, f: float) -> Rect
Expand rectangle by specified scalar amount on all sides, keeping origin the same.
Parameters:
- f Scalar value to expand with on all sides.
Returns A new rectangle that is the result of the expand operation on the current one.
expandPoint(self, v: Vec2) -> Rect
Expand rectangle by specified vector on all sides, keeping origin the same.
Parameters:
- v Vector to expand with in x and y directions.
Returns A new rectangle that is the result of the expand operation on the current one.
intersect(self, r: Rect) -> Rect
intersects(self, r: Rect) -> bool
pointInside(self, p: Vec2) -> bool
rectInside(self, r: Rect) -> bool
Special Methods
__add__(self, v: Vec2) -> Rect
__eq__(self, r: Rect) -> bool
__ne__(self, r: Rect) -> bool
__repr__(self) -> Any
String representation of the Rect