dEngine
Simple 2D C++ game engine
ProgressBarH.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 ProgressBarH : public UIComponent {
16  public:
22  void Setup(dengine::Vec2 initPos, int initAmount = 0){
23  completed = initAmount;
24  position = initPos;
25  }
26 
31  void SetFillColor(SDL_Color color){
32  fillColor = color;
33  }
34 
35  void Render() override;
36  void Update() override;
37 
38 
43  void SetCompleted(int completeAmount) {
44  completed = completeAmount;
45  }
46  private:
47  int completed;
49  SDL_Color fillColor;
50 
51  };
52 }
53 
54 
55 #endif //DENGINE_PROGRESSBARV_H
void SetFillColor(SDL_Color color)
Sets the fill color of the progress bar.
Definition: ProgressBarH.h:31
SDL_Color fillColor
Definition: ProgressBarH.h:49
dengine::Vec2 position
Definition: ProgressBarH.h:48
A horizontal progress bar Variables are: xpos - The x position of the progress bar ypos - The y posit...
Definition: ProgressBarH.h:15
void Update() override
The update method of a component.
Definition: ProgressBarH.cpp:8
A vector composed of two points.
Definition: Vec2.h:11
A component of a UI window.
Definition: UIComponent.h:14
Definition: Circle.h:11
void SetCompleted(int completeAmount)
Sets the filled progress of the progress bar.
Definition: ProgressBarH.h:43
int completed
Definition: ProgressBarH.h:47
void Render() override
The render method of a component.
Definition: ProgressBarH.cpp:10
void Setup(dengine::Vec2 initPos, int initAmount=0)
Initializes required parameters.
Definition: ProgressBarH.h:22