dEngine
Simple 2D C++ game engine
Public Member Functions | Protected Attributes | List of all members
dengine_UI::RoundedBox Class Reference

A rectangle with rounded corners. More...

#include <RoundedBox.h>

Inheritance diagram for dengine_UI::RoundedBox:
dengine_UI::UIComponent

Public Member Functions

void Setup (SDL_Rect rect, double width, int cornerRadius)
 Initializes a rectangle with rounded corners. More...
 
void Render () override
 The render method of a component. More...
 
void Update () override
 The update method of a component. More...
 
- Public Member Functions inherited from dengine_UI::UIComponent
void SetDrawColor (SDL_Color color)
 Set Draw Color. More...
 

Protected Attributes

SDL_Rect boxRect
 
int cornerR
 
double borderWidth
 
- Protected Attributes inherited from dengine_UI::UIComponent
SDL_Color drawColor
 

Additional Inherited Members

- Protected Member Functions inherited from dengine_UI::UIComponent
std::string GetVar (std::string key)
 

Detailed Description

A rectangle with rounded corners.

Member Function Documentation

◆ Render()

void RoundedBox::Render ( )
overridevirtual

The render method of a component.

During the render phase of the program, this function is what draws the component to the screen. This should be overridden for any UIComponents and actually be used to draw to the screen using one of the many SDL_Render functions available.

Implements dengine_UI::UIComponent.

◆ Setup()

void RoundedBox::Setup ( SDL_Rect  rect,
double  width,
int  cornerRadius 
)

Initializes a rectangle with rounded corners.

Parameters
rectThe rectangle
width
cornerRadiusThe radius of the corners

◆ Update()

void RoundedBox::Update ( )
overridevirtual

The update method of a component.

During the update phase of the program, this function is what updates and performs any logic within the component. This should be overridden for any UIComponents and actually be used to Update the internal logic of the component. This is called prior to the update anywhere else within the engine.

Implements dengine_UI::UIComponent.

Member Data Documentation

◆ borderWidth

double dengine_UI::RoundedBox::borderWidth
protected

◆ boxRect

SDL_Rect dengine_UI::RoundedBox::boxRect
protected

◆ cornerR

int dengine_UI::RoundedBox::cornerR
protected