-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlayerGui.h
68 lines (45 loc) · 1.19 KB
/
PlayerGui.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#pragma once
#include "PlayerTabPanel.h"
class PlayerGui
{
private:
// Variables:
Player* player;
sf::VideoMode& vm;
sf::Font font;
// HP Bar
gui::ProgressBar* hpBar;
// Level Bar
std::string levelBarString;
sf::Text levelBarText;
sf::RectangleShape levelBarBack;
sf::Texture levelBarTexture;
// EXP Bar
gui::ProgressBar* expBar;
// Player tab panel
PlayerTabPanel* playerTabs;
// private: Functions:
void initFont(sf::Font& font_name, const std::string file_path);
void initHpBar();
void initLevelBar();
void initExpBar();
void initPlayerTabPanel();
public:
// Constructors and Destructor:
PlayerGui(Player* player, sf::VideoMode& video_mode);
virtual ~PlayerGui();
// Accessors:
const bool isTabsOpen() const;
// Fucntions:
void toggleCharacterTab();
void updateHpBar(const float& dt);
void updateLevelBar(const float& dt);
void updateExpBar(const float& dt);
void updatePlayerTabPanel(const float& dt);
void update(const float& dt);
void renderHpBar(sf::RenderTarget& target);
void renderLevelBar(sf::RenderTarget& target);
void renderExpBar(sf::RenderTarget& target);
void renderPlayerTabPanel(sf::RenderTarget& target);
void render(sf::RenderTarget& target);
};