|
TGUI 1.x-dev
|
Public Member Functions | |
| constexpr | Rect ()=default |
| Default constructor. | |
| template<typename U> | |
| constexpr | Rect (const Rect< U > &rect) |
| Constructs the rectangle from an another Rect with a different type. | |
| constexpr | Rect (sf::Rect< T > rect) |
| Constructs the rectangle from an sf::Rect. | |
| constexpr | Rect (T rectLeft, T rectTop, T rectWidth, T rectHeight) |
| Constructs the rectangle from its position and size. | |
| constexpr | Rect (Vector2< T > position, Vector2< T > size) |
| Constructs the rectangle from its position and size. | |
| constexpr void | setPosition (Vector2< T > position) |
| Sets the position of the rectangle. | |
| constexpr Vector2< T > | getPosition () const |
| Returns the position of the rectangle. | |
| constexpr void | setSize (Vector2< T > size) |
| Sets the size of the rectangle. | |
| constexpr Vector2< T > | getSize () const |
| Returns the size of the rectangle. | |
| operator sf::Rect< T > () const | |
| Converts the Rect to an sf::Rect. | |
| constexpr bool | contains (const Vector2< T > &pos) const |
| Check if a point is inside the rectangle's area. | |
| constexpr bool | intersects (const Rect< T > &rect) const |
| Check the intersection between two rectangles. | |
Public Attributes | |
| T | left = 0 |
| Left coordinate of the rectangle. | |
| T | top = 0 |
| Top coordinate of the rectangle. | |
| T | width = 0 |
| Width of the rectangle. | |
| T | height = 0 |
| Height of the rectangle. | |
|
constexprdefault |
Default constructor.
Creates an empty rectangle (it is equivalent to calling Rect{0, 0, 0, 0}).
|
inlineexplicitconstexpr |
Constructs the rectangle from an another Rect with a different type.
| rect | Rectangle to copy |
|
inlineexplicitconstexpr |
Constructs the rectangle from an sf::Rect.
| rect | Rectangle to initialize |
|
inlineconstexpr |
Constructs the rectangle from its position and size.
| rectLeft | Left coordinate of the rectangle |
| rectTop | Top coordinate of the rectangle |
| rectWidth | Width of the rectangle |
| rectHeight | Height of the rectangle |
|
inlineconstexpr |
Constructs the rectangle from its position and size.
| position | Position of the top-left corner of the rectangle |
| size | Size of the rectangle |
|
inlinenodiscardconstexpr |
Check if a point is inside the rectangle's area.
This check is non-inclusive. If the point lies on the edge of the rectangle, this function will return false.
| pos | Coordinate to test |
|
inlinenodiscardconstexpr |
Returns the position of the rectangle.
|
inlinenodiscardconstexpr |
Returns the size of the rectangle.
|
inlinenodiscardconstexpr |
Check the intersection between two rectangles.
| rect | Rectangle to test |
|
inlineconstexpr |
Sets the position of the rectangle.
| position | New position for the rectangle |
|
inlineconstexpr |
Sets the size of the rectangle.
| size | New size for the rectangle |