-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathText.h
More file actions
33 lines (27 loc) · 715 Bytes
/
Text.h
File metadata and controls
33 lines (27 loc) · 715 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 "Vector2D.h"
#include "Tickable.h"
#include "Sprite.h"
#include <string_view>
#include <unordered_map>
class Text : public Tickable
{
public:
enum class Alignment
{
left,
right,
center
};
Text(std::string text, std::unordered_map<char, Sprite>& alphabet, const Position position, const Alignment alignment, const Size size) noexcept;
void tick(const Time time) override;
void setText(const std::string string);
void setPosition(const Position& position);
void setSize(const Size& size);
private:
Vector2D position;
Size size;
std::string text;
std::unordered_map<char, Sprite>& alphabet;
Alignment alignment;
};