Plutonium framework API  0.1
Simple UI framework for libnx and SDL2
Rectangle.hpp
Go to the documentation of this file.
1 
2 /*
3 
4  Plutonium library
5 
6  @file Rectangle.hpp
7  @brief A Rectangle is an Element which simply draws a filled rectangle.
8  @author XorTroll
9 
10  @copyright Plutonium project - an easy-to-use UI framework for Nintendo Switch homebrew
11 
12 */
13 
14 #pragma once
15 #include <pu/element/Element.hpp>
16 
17 namespace pu::element
18 {
19  class Rectangle : public Element
20  {
21  public:
22  Rectangle(u32 X, u32 Y, u32 Width, u32 Height, draw::Color RecColor, u32 BorderRadius = 0);
23  u32 GetX();
24  void SetX(u32 X);
25  u32 GetY();
26  void SetY(u32 Y);
27  u32 GetWidth();
28  void SetWidth(u32 Width);
29  u32 GetHeight();
30  void SetHeight(u32 Height);
31  u32 GetBorderRadius();
32  void SetBorderRadius(u32 Radius);
34  void SetColor(draw::Color RecColor);
35  void OnRender(render::Renderer *Drawer);
36  void OnInput(u64 Down, u64 Up, u64 Held, bool Touch, bool Focus);
37  private:
38  u32 borderr;
39  u32 x;
40  u32 y;
41  u32 w;
42  u32 h;
43  draw::Color clr;
44  };
45 }
Definition: Renderer.hpp:22
void SetColor(draw::Color RecColor)
void SetHeight(u32 Height)
draw::Color GetColor()
Definition: Button.hpp:18
Rectangle(u32 X, u32 Y, u32 Width, u32 Height, draw::Color RecColor, u32 BorderRadius=0)
void OnRender(render::Renderer *Drawer)
void SetBorderRadius(u32 Radius)
Definition: Element.hpp:27
Definition: Rectangle.hpp:19
void SetWidth(u32 Width)
Definition: Color.hpp:19
void OnInput(u64 Down, u64 Up, u64 Held, bool Touch, bool Focus)