From 871943d6a90bdb92b3cc495d4d927199611f8c6b Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Thu, 4 Feb 2021 20:45:18 -0500 Subject: 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. --- src/font.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/font.h (limited to 'src/font.h') 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 @@ +#ifndef FONT_H_C80183A7 +#define FONT_H_C80183A7 + +#include +#include +#include "vector.h" + +class Renderer; + +class Font { +public: + + Font(std::string_view filename, Renderer& renderer); + + int getTextureId() const { return textureId_; } + + vec2i getCharacterLocation(char ch) const; + + vec2i getCharacterSize(char ch) const; + + int getCharacterWidth(char ch) const; + + int getCharacterHeight() const { return tileSize_.h(); } + +private: + + int textureId_; + int columns_; + vec2i tileSize_; + std::vector widths_; +}; + +#endif /* end of include guard: FONT_H_C80183A7 */ -- cgit 1.4.1