-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVisualText.hpp
More file actions
33 lines (26 loc) · 928 Bytes
/
VisualText.hpp
File metadata and controls
33 lines (26 loc) · 928 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
#pragma once
#include <SFML/Graphics.hpp>
class VisualText {
private:
sf::Font font;
sf::Text particleCount, timeBetweenFrames;
public:
VisualText() {
font.loadFromFile("../assets/arial.ttf");
particleCount.setFont(font);
particleCount.setString("--");
particleCount.setCharacterSize(24);
particleCount.setFillColor(sf::Color::Black);
timeBetweenFrames.setFont(font);
timeBetweenFrames.setString("--");
timeBetweenFrames.setCharacterSize(24);
timeBetweenFrames.setFillColor(sf::Color::Black);
timeBetweenFrames.setPosition(0.f, 30.f);
}
void draw(sf::RenderWindow& window) const {
window.draw(particleCount);
window.draw(timeBetweenFrames);
}
void setParticle(std::string cnt) { particleCount.setString(cnt); }
void setFrames(std::string cnt) { timeBetweenFrames.setString(cnt + "ms"); }
};