jade-engine  0.0
JadeEngine::Text Class Reference
Inheritance diagram for JadeEngine::Text:
JadeEngine::IGameObject

Public Member Functions

 Text (const TextParams &params)
 
LoadState Load (SDL_Renderer *renderer) override
 
void Render (SDL_Renderer *renderer) override
 
void SetText (const std::string &text)
 
void SetTextFast (const std::string &text)
 
void SetTextAndColor (const std::string &text, const SDL_Color &color)
 
void SetColor (const SDL_Color &color)
 
void SetMask (const Rectangle &mask)
 
void Clean () override
 
const SDL_Color & GetColor () const
 
TTF_Font * GetFont () const
 
const std::string & GetText () const
 
- Public Member Functions inherited from JadeEngine::IGameObject
 IGameObject ()
 
virtual void Update ()
 
LoadState GetLoadState () const
 
void SetLoadState (const LoadState newState)
 
bool IsShown () const
 
virtual void Show (const bool show)
 
int32_t GetZ () const
 
void Destroy ()
 
bool DestructionWanted () const
 

Protected Attributes

std::string _text
 
- Protected Attributes inherited from JadeEngine::IGameObject
LoadState _loadState
 
bool _shown
 
int32_t _z
 

Additional Inherited Members

- Public Attributes inherited from JadeEngine::IGameObject
const std::shared_ptr< Transformtransform
 

Member Function Documentation

◆ Clean()

void JadeEngine::Text::Clean ( )
overridevirtual

Triggered when the game object is about to be destroyed or reset.

All resources belonging solely to the game object, such as textures, should be released at this point. The game object instance itself may or may not be destroyed after this callback.

Reimplemented from JadeEngine::IGameObject.

◆ Load()

LoadState JadeEngine::Text::Load ( SDL_Renderer *  renderer)
overridevirtual

Triggered every frame when GetLoadState function returns kLoadState_Wanted to allow resources, such as textures, to be loaded.

The trigger order is the following: IScene::PreUpdate -> IGameObject::Load -> IGameObject::Update -> IScene::Update -> IGameObject::Load -> IGameObject::Render.

Parameters
rendererThe engine's SDL2 renderer that can be used to create resources.
Returns
The function must return the load state that reflects the result of the load operation. It will be used in SetLoadState function by the Game class.
See also
GetLoadState

Reimplemented from JadeEngine::IGameObject.

◆ Render()

void JadeEngine::Text::Render ( SDL_Renderer *  renderer)
overridevirtual

Triggered every frame while the scene that owns this game object is active, the game object was successfully loaded and the game object is shown.

The trigger order is the following: IScene::PreUpdate -> IGameObject::Load -> IGameObject::Update -> IScene::Update -> IGameObject::Load -> IGameObject::Render.

Parameters
rendererThe engine's SDL2 renderer that should be used to render the game object.
See also
IGameObject::Update, LoadState, IGameObject::IsShown

Reimplemented from JadeEngine::IGameObject.


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