Aether
SDL2 based UI Framework for NX
Rectangle.hpp
1 #ifndef AETHER_RECTANGLE_HPP
2 #define AETHER_RECTANGLE_HPP
3 
4 #include "Aether/base/Texture.hpp"
5 
6 namespace Aether {
11  class Rectangle : public Texture {
12  private:
14  unsigned int cornerRadius_;
15 
19  Drawable * renderDrawable();
20 
21  public:
31  Rectangle(const int x, const int y, const int w, const int h, const unsigned int radius = 0);
32 
38  unsigned int cornerRadius();
39 
45  void setCornerRadius(const unsigned int r);
46 
53  void setRectSize(const int w, const int h);
54  };
55 };
56 
57 #endif
A rectangle is a texture containing either a normal or rounded rectangle.
Definition: Rectangle.hpp:11
Rectangle(const int x, const int y, const int w, const int h, const unsigned int radius=0)
Constructs a new Rectangle element.
int w()
Returns width of element.
Stores either a surface or texture which can be drawn on screen by providing a renderer to render()...
Definition: Drawable.hpp:22
int x()
Returns x-coordinate of element.
A Texture is an element that stores a texture to render in the window. It can't be instantiated alone...
Definition: Texture.hpp:24
int h()
Returns height of element.
Base namespace for all Aether related classes and functions.
void setRectSize(const int w, const int h)
Set new dimensions for the rectangle.
void setCornerRadius(const unsigned int r)
Set the new corner radius for the rectangle.
unsigned int cornerRadius()
Returns the corner radius of the rectangle.
int y()
Returns y-coordinate of element.