|
LPCGame
A Simple 2d Game Engine
|
A rectangle. More...
#include <rect.h>
Public Member Functions | |
| Rect (T pX, T pY, T pW, T pH) | |
| Rect (Vector2< T > pPos, T pW, T pH) | |
| Rect (Json::Value val) | |
| void | Set (const Rect< T > &r) |
| void | Set (T pX, T pY, T pW, T pH) |
| void | Set (Vector2< T > pPos, T pW, T pH) |
| void | Set (T pX, T pY) |
| void | Set (Vector2< T > pPos) |
| Vector2< T > | Pos () const |
| Get the rect's position vector. | |
| T | X () const |
| Get x value. | |
| T | Y () const |
| Get y value. | |
| T | W () const |
| Get width. | |
| T | H () const |
| Get height. | |
| Json::Value | Save () const |
| void | Load (Json::Value val) |
| bool | operator== (Rect< T > r) const |
| Operators. | |
| Rect< T > & | operator+= (Vector2f vec) |
| Rect< T > | operator+ (const Vector2f v) const |
| Rect< T > | operator- (const Vector2f v) const |
| operator SDL_Rect () const | |
| For conversions. | |
| operator Rect< float > () const | |
| operator Rect< int > () const | |
| operator std::string () const | |
Public Attributes | |
| Vector2< T > | pos |
| T | w |
| T | h |
A rectangle.
Describes a rectangle, can use ints, floats or doubles to represent its values
Construct the rect and set its properties
| pX | The x position |
| pY | The y position |
| pW | The width |
| pH | The height |
Construct the rect and set its properties
| pPos | The position, as a vector |
| pW | The width |
| pH | The height |
|
inline |
Set the rect's properties
| val | The Json::Value containing x, y, w, h |
|
inline |
Load the box's properties from a Json::Value
| val | The Json::Value containing the properties to load |
|
inline |
Save the box's properties to a Json::Value and return it
Set the rect to have the same values as some other rect
| r | The Rect to get values from |
|
inline |
Set the rect's properties
| pX | The x position |
| pY | The y position |
| pW | The width |
| pH | The height |
Set the rect's properties
| pPos | The position, as a vector |
| pW | The width |
| pH | The height |
|
inline |
Set the rect's position
| pX | The x position |
| pY | The y position |
Set the rect's position
| pPos | The position vector |