Practical Tools for Simple Design
Loading...
Searching...
No Matches
Util::Text Class Reference

A class representing a text. More...

#include <Text.hpp>

Inheritance diagram for Util::Text:
Core::Drawable

Public Member Functions

 Text (const std::string &font, int size, const std::string &text, const Util::Color &color=Color(127, 127, 127))
glm::vec2 GetSize () const override
void SetText (const std::string &text)
 Sets the text to the specified string.
void SetColor (const Util::Color &color)
 Sets the color of the text.
void Draw (const Core::Matrices &data) override
 Draws the text with a given transform and z-index.

Detailed Description

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.

Member Function Documentation

◆ Draw()

void Util::Text::Draw ( const Core::Matrices & data)
overridevirtual

Draws the text with a given transform and z-index.

Parameters
transformThe transform to apply to the text.
zIndexThe z-index at which to draw the text.

Implements Core::Drawable.

◆ GetSize()

glm::vec2 Util::Text::GetSize ( ) const
inlineoverridevirtual

Implements Core::Drawable.

◆ SetColor()

void Util::Text::SetColor ( const Util::Color & color)
inline

Sets the color of the text.

Parameters
colorThe color to set.

◆ SetText()

void Util::Text::SetText ( const std::string & text)
inline

Sets the text to the specified string.

Parameters
textThe string to set.

The documentation for this class was generated from the following file: