-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbar.cpp
More file actions
34 lines (27 loc) · 667 Bytes
/
Copy pathbar.cpp
File metadata and controls
34 lines (27 loc) · 667 Bytes
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
#include "bar.hpp"
#include "params.hpp"
Bar::Bar(int value) {
mValue = value;
mBar.setSize(sf::Vector2f(BAR_WIDTH, value));
mBar.setFillColor(sf::Color::White);
mBar.rotate(180);
mBar.move(sf::Vector2f(10,WIN_HEIGHT));
}
void Bar::move(sf::Vector2f relativePos) {
mBar.move(relativePos);
}
void Bar::setPosition(sf::Vector2f position) {
mBar.setPosition(position);
}
sf::Vector2f Bar::getPosition() const {
return mBar.getPosition();
}
void Bar::setColor(sf::Color color) {
mBar.setFillColor(color);
}
int Bar::getValue() const{
return mValue;
}
void Bar::draw(sf::RenderWindow &window) const {
window.draw(mBar);
}