-
Notifications
You must be signed in to change notification settings - Fork 1
/
Text.h
42 lines (30 loc) · 789 Bytes
/
Text.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
#ifndef SUPERMARIOBROS_TEXT_H
#define SUPERMARIOBROS_TEXT_H
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
#include <memory>
#include <string>
void initializeHUDOverlay(const std::string& resourceDir);
class Text
{
public:
Text(const std::string& content, const sf::Vector2f& position);
virtual ~Text()
{
}
void updateString(const std::string& newString);
void draw(sf::RenderWindow& window) const;
void updatePosition(float deltaX, float deltaY);
private:
sf::Text mSfText;
};
class Points : public Text
{
public:
Points(size_t numPoints, const sf::Vector2f& position);
void addPoints(size_t newPoints);
private:
static std::string formatPoints(size_t numPoints);
size_t mNumPoints;
};
#endif // SUPERMARIOBROS_TEXT_H