|
|
constexpr | Rectangle (int X, int Y, int W, int H) noexcept |
| |
|
constexpr | Rectangle (const Position< int > &p, const Size &s) noexcept |
| |
|
constexpr | Rectangle (const Rectangle &p)=default |
| |
|
constexpr | Rectangle (Rectangle &&p)=default |
| |
|
constexpr Rectangle & | operator= (const Rectangle &p)=default |
| |
|
constexpr Rectangle & | operator= (Rectangle &&p)=default |
| |
|
constexpr Rectangle & | operator= (const Size &s) |
| |
|
constexpr Rectangle & | operator= (const Position< int > &p) |
| |
|
constexpr Rectangle | operator+ (const Position< int > &p) const noexcept |
| | Add a Position to a Rectangle.
|
| |
|
constexpr Rectangle | operator+ (const Size &s) const noexcept |
| | Add a Size to a Rectangle.
|
| |
|
constexpr Rectangle | operator- (const Size &s) const noexcept |
| | Subtract a Size from a Rectangle.
|
| |
|
Position< int > | position () const noexcept |
| | Get a Position from a Rectangle.
|
| |
|
Size | size () const noexcept |
| | Get a Size from a Rectangle.
|
| |
|
std::pair< Position< int >, Position< int > > | primeCorners () const noexcept |
| | Get the Positions of top-left and bottom-right corners defined by the Rectangle.
|
| |
|
std::pair< Position< int >, Position< int > > | crossCorners () const noexcept |
| | Get the Positions of the top-right and bottom-left corners defined by the Rectangle.
|
| |
|
std::tuple< Position< int >, Position< int >, Position< int >, Position< int > > | corners () const noexcept |
| | Get the Positions of all four corners defined by the Rectangle, top to bottom, left to right.
|
| |
|
constexpr bool | contains (Position< int > pos) const noexcept |
| | Determine if a Rectangle contains a Position.
|
| |
| constexpr bool | noOverlap (const Rectangle &o) const noexcept |
| | Determine if there is no overlap between two Rectangle objects. More...
|
| |
| constexpr bool | overlap (const Rectangle &o) const noexcept |
| | Determine if there is overlap between to Rectangle objects by inverting noOverlap(). More...
|
| |
|
Rectangle | intersection (const Rectangle &o) const |
| |
|
int & | sizePri (Orientation o) noexcept |
| |
|
int & | sizeSec (Orientation o) noexcept |
| |
|
int & | posPri (Orientation o) noexcept |
| |
|
int & | posSec (Orientation o) noexcept |
| |
|
constexpr int | sizePri (Orientation o) const noexcept |
| |
|
constexpr int | sizeSec (Orientation o) const noexcept |
| |
|
constexpr int | posPri (Orientation o) const noexcept |
| |
|
constexpr int | posSec (Orientation o) const noexcept |
| |
|
constexpr | Rectangle (std::array< int, 4 > value) noexcept |
| | Constructor initialize to the value of an array.
|
| |
|
constexpr | Rectangle (int value=0) noexcept |
| | Default constructor initializes x and y to 0 or to a specified value.
|
| |
|
constexpr | Rectangle (int x, int y, int width, int height) noexcept |
| | Constructor initialize to descrete x, y, width, and height values.
|
| |
|
constexpr | Rectangle (const Rectangle &)=default |
| | Copy constructor.
|
| |
|
constexpr | Rectangle (Rectangle &&)=default |
| | Move constructor.
|
| |
|
constexpr Rectangle & | operator= (const Rectangle &)=default |
| | Copy assignment.
|
| |
|
constexpr Rectangle & | operator= (Rectangle &&)=default |
| | Move assignment.
|
| |
|
constexpr | Rectangle (const Position &pos, const Size &size) |
| | Constructor initialize to the value of a Position and Size.
|
| |
|
constexpr | Rectangle (const std::optional< Position > &pos, const std::optional< Size > &size) |
| | Constructor initialize to the value of std::optional Position and Size.
|
| |
|
constexpr int & | x () |
| | Reference access to x.
|
| |
|
constexpr int | x () const noexcept |
| | Value access to x.
|
| |
|
constexpr int & | y () |
| | Reference access to y.
|
| |
|
constexpr int | y () const noexcept |
| | Value access to y.
|
| |
|
constexpr int & | width () |
| | Reference access to width.
|
| |
|
constexpr int | width () const noexcept |
| | Value access to width.
|
| |
|
constexpr int & | height () |
| | Reference access to height.
|
| |
|
constexpr int | height () const noexcept |
| | Value access to height.
|
| |
|
constexpr int & | positionPrimary (Orientation orientation) |
| |
|
constexpr int & | positionSecondary (Orientation orientation) |
| |
|
constexpr int & | sizePrimary (Orientation orientation) |
| |
|
constexpr int & | sizeSecondary (Orientation orientation) |
| |
|
constexpr Size | getSize () const noexcept |
| | Get the Size of a Rectangle.
|
| |
|
constexpr Position | getPosition () const noexcept |
| | Get the Position of a Rectangle.
|
| |
|
constexpr SDL_Rect | toSdlRect () const noexcept |
| |
|
constexpr Rectangle & | operator= (const Size &size) |
| | Assign a Size to a Rectangle.
|
| |
|
constexpr Rectangle & | operator= (const Position &position) |
| | Assign a Position to a Rectangle.
|
| |
|
constexpr Rectangle & | operator+= (const Position &deltaPos) |
| | Move a Rectangle by a delta Position.
|
| |
|
constexpr Rectangle | operator+ (const Position &deltaPos) |
| | Add a Position to a Rectangle.
|
| |
|
constexpr Rectangle | moveOrigin (const std::optional< Position > &deltaPos) const |
| | Move the origin of a Rectangle by an optional deltaPos and reduce the size of the rectangle by a corresponding amount.
|
| |
|
constexpr bool | contains (Position pos) const noexcept |
| | Determine if a Rectangle contains a Position.
|
| |
| constexpr bool | noOverlap (const Rectangle &o) const noexcept |
| | Determine if there is no overlap between two Rectangle objects. More...
|
| |
| constexpr bool | overlap (const Rectangle &o) const noexcept |
| | Determine if there is overlap between to Rectangle objects by inverting noOverlap(). More...
|
| |
|
Rectangle | intersection (const Rectangle &o) const |
| |
A composite of a Position and a Size.
Describes area on the screen.
Position may be relative or absolute.