SDL Utility
Rectangle.hpp
Go to the documentation of this file.
1 
7 #pragma once
8 
9 #include "Shape.hpp"
10 
11 namespace sdlu
12 {
13  class Rectangle :
14  public Shape
15  {
16  public:
21 
28  Rectangle(const Vector2f& position, const Vector2f& size);
29 
36 
42  void SetSize(const Vector2f& size);
43 
50  void SetSize(float x, float y);
51 
57  virtual void Draw(SDL_Renderer* const target) const override;
58 
59  private:
60  Vector2f size;
61  };
62 }
The base class for all native SDLU shapes.
The non-instantiable base class for all SDLU shapes.
Definition: Shape.hpp:19
Vector2f position
Position of the object.
Definition: Transformable.hpp:152
Definition: Rectangle.hpp:15
Vector2f GetSize()
Gets the size of the rectangle.
void SetSize(float x, float y)
Sets a new size for the rectangle.
Rectangle(const Vector2f &position, const Vector2f &size)
Constructor with default parameters.
Rectangle()
Default constructor.
virtual void Draw(SDL_Renderer *const target) const override
Draws the Rectangle to the target.
void SetSize(const Vector2f &size)
Sets a new size for the rectangle.
Definition: Rectangle.hpp:12