dEngine
Simple 2D C++ game engine
ProgressBarV.h
Go to the documentation of this file.
1 #ifndef DENGINE_PROGRESSBARV_H
2 #define DENGINE_PROGRESSBARV_H
3 #include <SDL.h>
4 #include "../UIComponent.h"
5 #include "../../Vec2.h"
6 
7 namespace dengine_UI {
15  class ProgressBarV : public UIComponent {
16  public:
22  void Setup(dengine::Vec2 initPos, int initAmount = 0){
23  completed = initAmount;
24  position = initPos;
25  }
26  void Render() override;
27  void Update() override;
28 
29 
34  void SetFillColor(SDL_Color color){
35  fillColor = color;
36  }
37 
42  void SetCompleted(int completeAmount) {
43  completed = completeAmount;
44  }
45  private:
46  int completed;
48  SDL_Color fillColor;
49  };
50 }
51 
52 #endif //DENGINE_PROGRESSBARV_H
void SetFillColor(SDL_Color color)
Sets the fill color of the progress bar.
Definition: ProgressBarV.h:34
void Render() override
The render method of a component.
Definition: ProgressBarV.cpp:10
A verticle progress bar Variables are: xpos - The x position of the progress bar ypos - The y positio...
Definition: ProgressBarV.h:15
A vector composed of two points.
Definition: Vec2.h:11
A component of a UI window.
Definition: UIComponent.h:14
void Setup(dengine::Vec2 initPos, int initAmount=0)
Initializes required parameters.
Definition: ProgressBarV.h:22
Definition: Circle.h:11
int completed
Definition: ProgressBarV.h:46
SDL_Color fillColor
Definition: ProgressBarV.h:48
void SetCompleted(int completeAmount)
Sets the filled progress of the progress bar.
Definition: ProgressBarV.h:42
void Update() override
The update method of a component.
Definition: ProgressBarV.cpp:8
dengine::Vec2 position
Definition: ProgressBarV.h:47