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

A verticle progress bar Variables are: xpos - The x position of the progress bar ypos - The y position of the progress bar completed - The amount completed on a scale of 0 - 100. More...

#include <ProgressBarV.h>

Inheritance diagram for dengine_UI::ProgressBarV:
dengine_UI::UIComponent

Public Member Functions

void Setup (dengine::Vec2 initPos, int initAmount=0)
 Initializes required parameters. More...
 
void Render () override
 The render method of a component. More...
 
void Update () override
 The update method of a component. More...
 
void SetFillColor (SDL_Color color)
 Sets the fill color of the progress bar. More...
 
void SetCompleted (int completeAmount)
 Sets the filled progress of the progress bar. More...
 
- Public Member Functions inherited from dengine_UI::UIComponent
void SetDrawColor (SDL_Color color)
 Set Draw Color. More...
 

Private Attributes

int completed
 
dengine::Vec2 position
 
SDL_Color fillColor
 

Additional Inherited Members

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

Detailed Description

A verticle progress bar Variables are: xpos - The x position of the progress bar ypos - The y position of the progress bar completed - The amount completed on a scale of 0 - 100.

Member Function Documentation

◆ Render()

void ProgressBarV::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.

Referenced by Setup().

◆ SetCompleted()

void dengine_UI::ProgressBarV::SetCompleted ( int  completeAmount)
inline

Sets the filled progress of the progress bar.

Parameters
completeAmountNumber between 0 and 100

◆ SetFillColor()

void dengine_UI::ProgressBarV::SetFillColor ( SDL_Color  color)
inline

Sets the fill color of the progress bar.

Parameters
colorFill color

◆ Setup()

void dengine_UI::ProgressBarV::Setup ( dengine::Vec2  initPos,
int  initAmount = 0 
)
inline

Initializes required parameters.

Parameters
initPosThe X,Y coordinates of the bar on the screen
initAmountThe initial value of the progress bar (0)

◆ Update()

void ProgressBarV::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.

Referenced by Setup().

Member Data Documentation

◆ completed

int dengine_UI::ProgressBarV::completed
private

Referenced by SetCompleted(), and Setup().

◆ fillColor

SDL_Color dengine_UI::ProgressBarV::fillColor
private

Referenced by SetFillColor().

◆ position

dengine::Vec2 dengine_UI::ProgressBarV::position
private

Referenced by Setup().