-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathInfoBar.hpp
More file actions
71 lines (68 loc) · 2.03 KB
/
InfoBar.hpp
File metadata and controls
71 lines (68 loc) · 2.03 KB
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
68
69
70
71
#ifndef EVOAI_INFO_BAR_HPP
#define EVOAI_INFO_BAR_HPP
#include <SFML/Graphics/RectangleShape.hpp>
#include <SFML/Graphics/RenderWindow.hpp>
namespace EvoAI{
/**
* @brief Info Bar health, stamina and nutrients bar,
*/
class InfoBar{
public:
/**
* @brief constructor
* @param width
* @param height
*/
InfoBar(float width = 100.0, float height = 15.0);
/**
* @brief sets position
* @param x
* @param y
*/
void setPosition(float x, float y) noexcept;
/**
* @brief sets position
* @param pos
*/
void setPosition(sf::Vector2f pos) noexcept;
/**
* @brief sets sf::Color of the background
* @param c
*/
void setBackgroundFillColor(sf::Color c) noexcept;
/**
* @brief sets sf::Color of the info
* @param c
*/
void setFillColor(sf::Color c) noexcept;
/**
* @brief sets the outlinee sf::Color of info.
* @param c
*/
void setOutlineColor(sf::Color c) noexcept;
/**
* @brief sets alpha channel of background and info.
* @param value
*/
void adjustAlphaChannel(sf::Uint8 value) noexcept;
/**
* @brief updates the info value.
* @param value
*/
void updateInfo(float value) noexcept;
/**
* @brief render info bar
* @param win
*/
void render(sf::RenderWindow& win) noexcept;
/**
* @brief gets width and height
* @return
*/
sf::Vector2f getSize() const noexcept;
private:
sf::RectangleShape background;
sf::RectangleShape info;
};
}
#endif // EVOAI_INFO_BAR_HPP