diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-04 20:45:18 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-04 20:45:18 -0500 |
commit | 871943d6a90bdb92b3cc495d4d927199611f8c6b (patch) | |
tree | 9be125438747f7370cfa56e3f3e42f8c68982852 /src/font.h | |
parent | 138e0a8f83e82c6109bfc387ac7417d4f41711b4 (diff) | |
download | tanetane-871943d6a90bdb92b3cc495d4d927199611f8c6b.tar.gz tanetane-871943d6a90bdb92b3cc495d4d927199611f8c6b.tar.bz2 tanetane-871943d6a90bdb92b3cc495d4d927199611f8c6b.zip |
Added text boxes
Text now reveals itself and scrolls! Yay! It even plays speaker beeps. TODO: the arror indicating an A press is needed. Bullets on lines that need bullets. The header that says who the speaker is, if relevant.
Diffstat (limited to 'src/font.h')
-rw-r--r-- | src/font.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/font.h b/src/font.h new file mode 100644 index 0000000..fd24830 --- /dev/null +++ b/src/font.h | |||
@@ -0,0 +1,33 @@ | |||
1 | #ifndef FONT_H_C80183A7 | ||
2 | #define FONT_H_C80183A7 | ||
3 | |||
4 | #include <string_view> | ||
5 | #include <vector> | ||
6 | #include "vector.h" | ||
7 | |||
8 | class Renderer; | ||
9 | |||
10 | class Font { | ||
11 | public: | ||
12 | |||
13 | Font(std::string_view filename, Renderer& renderer); | ||
14 | |||
15 | int getTextureId() const { return textureId_; } | ||
16 | |||
17 | vec2i getCharacterLocation(char ch) const; | ||
18 | |||
19 | vec2i getCharacterSize(char ch) const; | ||
20 | |||
21 | int getCharacterWidth(char ch) const; | ||
22 | |||
23 | int getCharacterHeight() const { return tileSize_.h(); } | ||
24 | |||
25 | private: | ||
26 | |||
27 | int textureId_; | ||
28 | int columns_; | ||
29 | vec2i tileSize_; | ||
30 | std::vector<int> widths_; | ||
31 | }; | ||
32 | |||
33 | #endif /* end of include guard: FONT_H_C80183A7 */ | ||