Rect
Axis-aligned rectangle defined by an origin and a size.
Rect represents a 2D region with a top-left origin and Y increasing downward, matching canvas and image coordinates. It is used to select a sub-region of a texture.
Construction
Constructors
Rect() constexpr
Constructs a rectangle from its origin and size.
cpp
Rect::Rect(float x, float y, float width, float height);| Parameter | Description |
|---|---|
| x | Left edge. |
| y | Top edge. |
| width | Width of the rectangle. |
| height | Height of the rectangle. |
Properties
height float
Height of the rectangle.
cpp
float height {0.0f};width float
Width of the rectangle.
cpp
float width {0.0f};x float
Left edge.
cpp
float x {0.0f};y float
Top edge.
cpp
float y {0.0f};