-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgressBar.h
50 lines (34 loc) · 1.09 KB
/
ProgressBar.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#pragma once
namespace gui
{
class ProgressBar
{
private:
//Variables:
std::string barString;
sf::Text text;
sf::Font* fontPointer;
float widthMax;
sf::RectangleShape back;
sf::RectangleShape inner;
sf::Texture backTexture;
sf::Texture innerTexture;
public:
// Constructors and Destructor:
ProgressBar(float x, float y, float width, float height, sf::Font* font = nullptr, unsigned int char_size = 20u);
virtual ~ProgressBar();
// Modifiers:
void setBackColor(const sf::Color& color);
void setBackTexture(const std::string& file_path);
void setInnerColor(const sf::Color& color);
void setInnerTexture(const std::string& file_path);
void setPosition(const float x, const float y);
void setPosition(const sf::Vector2f& position);
void setTextString(const std::string& str);
void setTextPosition(const float x, const float y);
void setTextPosition(const sf::Vector2f& position);
// Functions:
void update(const int current_value, const int max_value, const float& dt, const bool update_color = false);
void render(sf::RenderTarget& target);
};
}