SDL Utility
|
#include <Rectangle.hpp>
Public Member Functions | |
Rectangle () | |
Default constructor. More... | |
Rectangle (const Vector2f &position, const Vector2f &size) | |
Constructor with default parameters. More... | |
Vector2f | GetSize () |
Gets the size of the rectangle. More... | |
void | SetSize (const Vector2f &size) |
Sets a new size for the rectangle. More... | |
void | SetSize (float x, float y) |
Sets a new size for the rectangle. More... | |
virtual void | Draw (SDL_Renderer *const target) const override |
Draws the Rectangle to the target. More... | |
![]() | |
virtual | ~Shape () |
Deconstructor. More... | |
void | SetColor (const Color &color) |
Sets the color of the shape. More... | |
Color | GetColor () |
Gets the color of the shape. More... | |
![]() | |
Drawable (const Drawable &other)=delete | |
Drawable (Drawable &&other)=delete | |
Drawable & | operator= (const Drawable &other)=delete |
![]() | |
Transformable () | |
Default constructur. More... | |
virtual | ~Transformable () |
Deconstructor. More... | |
Vector2f | GetPosition () |
Returns the position of the object. More... | |
void | SetPosition (const Vector2f &position) |
Sets a new position. More... | |
void | SetPosition (float x, float y) |
Sets a new position. More... | |
void | Move (const Vector2f &position) |
Adds to the current position. More... | |
void | Move (float x, float y) |
Adds to the current position. More... | |
Vector2f | GetOrigin () |
Gets the current local origin. More... | |
void | SetOrigin (const Vector2f &origin) |
Sets a new local origin. More... | |
void | SetOrigin (float x, float y) |
Sets a new local origin. More... | |
Vector2f | GetScale () |
Gets the current scale of the object. More... | |
void | SetScale (const Vector2f &scale) |
Sets a new scale. More... | |
void | SetScale (float x, float y) |
Sets a new scale. More... | |
void | Scale (const Vector2f &scale) |
Scales the object by some amount. More... | |
void | Scale (float x, float y) |
Scales the object by some amount. More... | |
float | GetRotation () |
Gets the current rotation. More... | |
void | SetRotation (float angle) |
Sets a new rotation. More... | |
void | Rotate (float angle) |
Rotates by some amount. More... | |
Additional Inherited Members | |
![]() | |
Shape () | |
Default constructor. More... | |
![]() | |
Drawable () | |
![]() | |
Color | color |
![]() | |
Vector2f | position |
Position of the object. More... | |
Vector2f | origin |
Offset of the top-left corner from the position. More... | |
Vector2f | scale |
Scale of the object. More... | |
float | rotation |
Rotation of the object (in degrees) More... | |
sdlu::Rectangle::Rectangle | ( | ) |
Default constructor.
Constructor with default parameters.
[in] | position | A 2D position vector |
[in] | size | A 2D size vector |
|
overridevirtual |
Draws the Rectangle to the target.
[in] | target | The RenderTarget to draw to |
Implements Drawable.
Vector2f sdlu::Rectangle::GetSize | ( | ) |
Gets the size of the rectangle.
void sdlu::Rectangle::SetSize | ( | const Vector2f & | size | ) |
Sets a new size for the rectangle.
[in] | size | A 2D vector with the size information |
void sdlu::Rectangle::SetSize | ( | float | x, |
float | y | ||
) |
Sets a new size for the rectangle.
[in] | x | The new size in x direction |
[in] | y | The new size in y direction |