WARNING : this is the documentation for an old version of SFML. The documentation for the latest official release is available through the main menu.
WARNING : this is the documentation for an old version of SFML. The documentation for the latest official release is available through the main menu.
Rect is an utility class for manipulating rectangles. More...
#include <Rect.hpp>
Public Member Functions | |
| Rect () | |
| Default constructor. | |
| Rect (T LeftCoord, T TopCoord, T RightCoord, T BottomCoord) | |
| Construct the rectangle from its coordinates. | |
| T | GetWidth () const |
| Get the width of the rectangle. | |
| T | GetHeight () const |
| Get the height of the rectangle. | |
| void | Offset (T OffsetX, T OffsetY) |
| Move the whole rectangle by the given offset. | |
| bool | Contains (T X, T Y) const |
| Check if a point is inside the rectangle's area. | |
| bool | Intersects (const Rect< T > &Rectangle, Rect< T > *OverlappingRect=NULL) const |
| Check intersection between two rectangles. | |
Public Attributes | |
| T | Left |
| Left coordinate of the rectangle. | |
| T | Top |
| Top coordinate of the rectangle. | |
| T | Right |
| Right coordinate of the rectangle. | |
| T | Bottom |
| Bottom coordinate of the rectangle. | |
Rect is an utility class for manipulating rectangles.
Template parameter defines the type of coordinates (integer, float, ...)
| Rect::Rect | ( | T | LeftCoord, |
| T | TopCoord, | ||
| T | RightCoord, | ||
| T | BottomCoord | ||
| ) |
Construct the rectangle from its coordinates.
Construct the color from its coordinates.
| LeftCoord | : Left coordinate of the rectangle |
| TopCoord | : Top coordinate of the rectangle |
| RightCoord | : Right coordinate of the rectangle |
| BottomCoord | : Bottom coordinate of the rectangle |
| bool sf::Rect< T >::Contains | ( | T | X, |
| T | Y | ||
| ) | const |
Check if a point is inside the rectangle's area.
| X | : X coordinate of the point to test |
| Y | : Y coordinate of the point to test |
| T sf::Rect< T >::GetHeight | ( | ) | const |
Get the height of the rectangle.
| T sf::Rect< T >::GetWidth | ( | ) | const |
Get the width of the rectangle.
| bool sf::Rect< T >::Intersects | ( | const Rect< T > & | Rectangle, |
| Rect< T > * | OverlappingRect = NULL |
||
| ) | const |
Check intersection between two rectangles.
| Rectangle | : Rectangle to test |
| OverlappingRect | : Rectangle to be filled with overlapping rect (NULL by default) |
| void sf::Rect< T >::Offset | ( | T | OffsetX, |
| T | OffsetY | ||
| ) |
Move the whole rectangle by the given offset.
| OffsetX | : Horizontal offset |
| OffsetY | : Vertical offset |