-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHUD.cpp
More file actions
33 lines (24 loc) · 703 Bytes
/
HUD.cpp
File metadata and controls
33 lines (24 loc) · 703 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
//
// Created by User on 27.06.2023.
//
#include "HUD.hpp"
HUD::HUD() {
initFont();
statView.setViewport(sf::FloatRect(0, 0, 0.5f, 0.5f));
}
void HUD::drawHUD(sf::RenderWindow &renderWindow) {
//renderWindow.setView(statView);
renderWindow.draw(this->hudText);
}
void HUD::updateHUD(const std::string &sortName) {
std::stringstream stringstream;
//todo more info to show about algorithm
stringstream << sortName;
this->hudText.setString(stringstream.str());
}
void HUD::initFont() {
this->hudFont.loadFromFile("Fonts/arial.ttf");
this->hudText.setFont(hudFont);
this->hudText.setFillColor(sf::Color::White);
this->hudText.setCharacterSize(32);
}