dEngine
Simple 2D C++ game engine
RoundedBox.h
Go to the documentation of this file.
1 #ifndef DENGINE_ROUNDEDBOX_H
2 #define DENGINE_ROUNDEDBOX_H
3 #include "../UIComponent.h"
4 #include <SDL.h>
5 #include <cmath>
6 
7 namespace dengine_UI {
11  class RoundedBox : public UIComponent {
12  public:
19  void Setup(SDL_Rect rect, double width, int cornerRadius);
20 
21  void Render() override;
22 
23  void Update() override;
24 
25  protected:
26  SDL_Rect boxRect;
27  int cornerR;
28  double borderWidth;
29  };
30 }
31 #endif //DENGINE_ROUNDEDBOX_H
int cornerR
Definition: RoundedBox.h:27
SDL_Rect boxRect
Definition: RoundedBox.h:26
A component of a UI window.
Definition: UIComponent.h:14
Definition: Circle.h:11
void Render() override
The render method of a component.
Definition: RoundedBox.cpp:9
A rectangle with rounded corners.
Definition: RoundedBox.h:11
void Setup(SDL_Rect rect, double width, int cornerRadius)
Initializes a rectangle with rounded corners.
Definition: RoundedBox.cpp:77
double borderWidth
Definition: RoundedBox.h:28
void Update() override
The update method of a component.
Definition: RoundedBox.cpp:7