Polygon Dash
Loading...
Searching...
No Matches
ComponentAttempt Class Reference

Render a number of attempts on screen. More...

Inheritance diagram for ComponentAttempt:
IComponent

Public Member Functions

 this (size_t owner, ComponentTextRenderer textRenderer)
 Setup the attempt counter.
 
int getAttempt ()
 Get the current attempt number.
 
void setAttempt (int attempt)
 Update the current attempt number.
 
override void Update ()
 Update the text on screen to show the new attempt.
 
override void Render (SDL_Renderer *renderer, SDL_Rect *camera)
 Render the given component.
 
- Public Member Functions inherited from IComponent

Public Attributes

ComponentTextRenderer mTextRenderer
 The ComponentTextRenderer of the attached GameObject.
 
int mAttempt = 1
 How many attempts have been made since opening the level.
 

Detailed Description

Render a number of attempts on screen.

The render itself is done using a ComponentTextRenderer.

See also
ComponentTextRenderer

Constructor & Destructor Documentation

◆ this()

ComponentAttempt::this ( size_t owner,
ComponentTextRenderer textRenderer )
inline

Setup the attempt counter.

Parameters
ownerthe id of the attached GameObject.
textRendererthe ComponentTextRenderer of the attached GameObject.

Member Function Documentation

◆ getAttempt()

int ComponentAttempt::getAttempt ( )
inline

Get the current attempt number.

Returns
the current attempt number.

◆ Render()

override void ComponentAttempt::Render ( SDL_Renderer * renderer,
SDL_Rect * camera )
inline

Render the given component.

Implements IComponent.

◆ setAttempt()

void ComponentAttempt::setAttempt ( int attempt)
inline

Update the current attempt number.

Parameters
attemptthe new attempt number.

◆ Update()

override void ComponentAttempt::Update ( )
inline

Update the text on screen to show the new attempt.

Implements IComponent.


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