32 inline void bindVAO() { this->m_vao.bind(); }
34 inline void bindVBO() { this->m_vbo.bind(); }
38 inline void setText(std::string text) { this->m_config.text = std::move(text); }
40 inline std::string getText()
const {
return this->m_config.text; }
42 inline void setColor(
const glm::vec4 &color) { this->m_config.color = color; }
44 inline glm::vec3 getColor()
const {
return this->m_config.color; }
46 inline glm::vec2 getPosition()
const {
return this->m_config.position; }
48 inline void setPosition(
const glm::vec2 &pos) { this->m_config.position = pos; }
50 inline float getScale()
const {
return this->m_config.scale; }
52 inline void setScale(
const float &scale) { this->m_config.scale = scale; }
64 bool m_created =
false;
67 class TextManager :
public Layer {
70 unsigned int textureId;
77 virtual void onAttach()
override;
79 virtual void onRender()
override;
81 Shared<Text> addText(
const TextHelper &config);
83 TextManager(TextManager &other) =
delete;
85 void operator=(
const TextManager &other) =
delete;
92 inline static Shared<TextManager> instance() {
93 if (s_pointer ==
nullptr) {
94 Shared<TextManager> copy(
new TextManager());
101 virtual ~TextManager()
override =
default;
104 TextManager() =
default;
106 inline static Shared<TextManager> s_pointer =
nullptr;
108 std::map<unsigned long long, Character> m_characters{};
109 std::vector<Shared<Text>> m_text{};
Definition TextManager.hpp:21
Definition TextManager.hpp:14