dEngine
Simple 2D C++ game engine
|
A component of a UI window. More...
#include <UIComponent.h>
Public Member Functions | |
virtual void | Render ()=0 |
The render method of a component. More... | |
virtual void | Update ()=0 |
The update method of a component. More... | |
void | SetDrawColor (SDL_Color color) |
Set Draw Color. More... | |
Protected Member Functions | |
std::string | GetVar (std::string key) |
Protected Attributes | |
SDL_Color | drawColor |
A component of a UI window.
This is a base level component that by itself does nothing. This should be used as a building block for other UI components. UI components are meant to be added to UIWindows and will be rendered from there.
|
protected |
Referenced by SetDrawColor().
|
pure virtual |
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.
Implemented in dengine_UI::ProgressBarH, dengine_UI::Text, dengine_UI::HollowRect, dengine_UI::ProgressBarV, dengine_UI::Circle, dengine_UI::FilledCircle, and dengine_UI::RoundedBox.
|
inline |
Set Draw Color.
Sets the draw color of the component
color | The color to draw the UI component in |
|
pure virtual |
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.
Implemented in dengine_UI::ProgressBarH, dengine_UI::Text, dengine_UI::HollowRect, dengine_UI::ProgressBarV, dengine_UI::Circle, dengine_UI::FilledCircle, and dengine_UI::RoundedBox.
|
protected |
Referenced by SetDrawColor().