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

Public Member Functions

 TextBox (const TextBoxParams &params)
 
LoadState Load (SDL_Renderer *renderer) override
 
void Render (SDL_Renderer *renderer) override
 
void Clean () override
 
void SetText (const std::string &text)
 
void SetPosition (int32_t x, int32_t y)
 
void SetCenterPosition (int32_t x, int32_t y)
 
int32_t GetX () const
 
int32_t GetY () const
 
int32_t GetCenterX () const
 
int32_t GetCenterY () const
 
int32_t GetWidth () const
 
int32_t GetHeight () 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
 

Additional Inherited Members

- Public Attributes inherited from JadeEngine::IGameObject
const std::shared_ptr< Transformtransform
 
- Protected Attributes inherited from JadeEngine::IGameObject
LoadState _loadState
 
bool _shown
 
int32_t _z
 

Member Function Documentation

◆ Clean()

void JadeEngine::TextBox::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::TextBox::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::TextBox::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: