ASW Lib
A.D.S. Games SDL Wrapper Library. A library targeted at Allegro4 users who want to switch to SDL3 and use modern c++.
Loading...
Searching...
No Matches
asw::game::Text Class Reference

Text Object. More...

#include <game.h>

Inheritance diagram for asw::game::Text:
[legend]
Collaboration diagram for asw::game::Text:
[legend]

Public Member Functions

void setFont (const asw::Font &font)
 Set the font of the text.
 
void setText (const std::string &text)
 Set the text of the text object.
 
void setColor (const asw::Color &color)
 Set the color of the text.
 
void update (float deltaTime) override
 Set the size of the text.
 
void draw () override
 Draw the object to the screen.
 
- Public Member Functions inherited from asw::game::GameObject
 GameObject ()=default
 
virtual ~GameObject ()=default
 
const asw::Quad< float > & getTransform () const
 Get transform.
 

Private Attributes

std::string text
 
asw::Font font
 
asw::Color color
 

Additional Inherited Members

- Public Attributes inherited from asw::game::GameObject
asw::Quad< float > transform
 The transform of the object.
 
float rotation {0}
 The rotation of the object in degrees.
 
int zIndex {0}
 The layer that the object is on.
 
bool active {true}
 Whether or not the object is active.
 
float alpha {1.0F}
 Opacity of the object.
 
Physics body
 Physics body of the object.
 
bool alive {true}
 Alive state.
 

Detailed Description

Text Object.

Definition at line 152 of file game.h.

Member Function Documentation

◆ draw()

void asw::game::Text::draw ( )
inlineoverridevirtual

Draw the object to the screen.

Reimplemented from asw::game::GameObject.

Definition at line 178 of file game.h.

◆ setColor()

void asw::game::Text::setColor ( const asw::Color & color)
inline

Set the color of the text.

Parameters
colorThe color to set.

Definition at line 170 of file game.h.

◆ setFont()

void asw::game::Text::setFont ( const asw::Font & font)
inline

Set the font of the text.

Parameters
fontThe font to set.

Definition at line 158 of file game.h.

◆ setText()

void asw::game::Text::setText ( const std::string & text)
inline

Set the text of the text object.

Parameters
textThe text to set.

Definition at line 164 of file game.h.

◆ update()

void asw::game::Text::update ( float deltaTime)
inlineoverridevirtual

Set the size of the text.

Parameters
sizeThe size of the text.

Reimplemented from asw::game::GameObject.

Definition at line 176 of file game.h.

Member Data Documentation

◆ color

asw::Color asw::game::Text::color
private

Definition at line 185 of file game.h.

◆ font

asw::Font asw::game::Text::font
private

Definition at line 184 of file game.h.

◆ text

std::string asw::game::Text::text
private

Definition at line 183 of file game.h.


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