Add GuiText:setText

This commit is contained in:
Maschell 2020-10-09 10:34:46 +02:00
parent c726432a07
commit e61d10c828
2 changed files with 8 additions and 0 deletions

View File

@ -63,6 +63,8 @@ public:
[[nodiscard]] const std::string getText() const;
void setText(const std::string& t);
protected:
GuiImage texture;
GuiTextureData *textureData = nullptr;

View File

@ -58,6 +58,12 @@ const std::string GuiText::getText() const {
return this->text;
}
void GuiText::setText(const std::string& t) {
this->text = t;
this->updateSize();
this->doUpdateTexture = true;
}
void GuiText::setFontSize(int32_t size) {
this->fc_font = this->gFont->getFont(size);
updateSize();