|
Practical Tools for Simple Design
|
A class representing a text. More...
#include <Text.hpp>
Public Member Functions | |
| Text (const std::string &font, int size, const std::string &text, const Util::Color &color=Color(127, 127, 127), bool useAA=true) | |
| Constructor for the Text class. More... | |
| glm::vec2 | GetSize () const override |
| void | SetText (const std::string &text) |
| Sets the text to the specified string. More... | |
| void | SetColor (const Util::Color &color) |
| Sets the color of the text. More... | |
| void | UseAntiAliasing (bool useAA) |
| Sets whether anti-aliasing (AA) should be enabled or disabled. More... | |
| void | Draw (const Core::Matrices &data) override |
| Draws the text with a given transform and z-index. More... | |
| virtual void | Draw (const Core::Matrices &data)=0 |
| virtual glm::vec2 | GetSize () const =0 |
A class representing a text.
This class encapsulates the properties and behaviors of a text. It includes properties such as texture and surface. It also includes behaviors such as drawing the text.
| Util::Text::Text | ( | const std::string & | font, |
| int | size, | ||
| const std::string & | text, | ||
| const Util::Color & | color = Color(127, 127, 127), |
||
| bool | useAA = true |
||
| ) |
Constructor for the Text class.
| font | The font file path or name. |
| size | The font size. |
| text | The text content to render. |
| color | The color of the text (default is gray). |
| useAA | Flag indicating whether anti-aliasing should be enabled (default is true). |
|
overridevirtual |
Draws the text with a given transform and z-index.
This function draws the image at the specified z-index and applies the given transform.
| transform | The transform to apply to the text. |
| zIndex | The z-index at which to draw the text. |
Implements Core::Drawable.
|
inlineoverridevirtual |
Implements Core::Drawable.
|
inline |
Sets the color of the text.
| color | The color to set. |
|
inline |
Sets the text to the specified string.
| text | The string to set. |
| void Util::Text::UseAntiAliasing | ( | bool | useAA | ) |
Sets whether anti-aliasing (AA) should be enabled or disabled.
| useAA | A boolean value indicating whether anti-aliasing should be enabled (true) or disabled (false). |