Game Engine 2D Platformer
|
LifeDisplayComponent class used to show character's HP. More...
#include <LifeDisplayComponent.hpp>
Public Member Functions | |
LifeDisplayComponent (SDL_Renderer *ren, std::string path) | |
Constuctor for LifeDisplayComponent. More... | |
~LifeDisplayComponent () | |
Destructor for LifeDisplayComponent. More... | |
void | StartUp () |
Initializes the attributes for LifeDisplayComponent. More... | |
void | ShutDown () |
Destroys and frees attributes for LifeDisplayComponent. More... | |
void | Update (GameEntity &entity) |
Updates the LifeDisplayComponent. More... | |
void | Render (GameEntity &entity) |
Renders the LifeDisplayComponent. More... | |
Public Member Functions inherited from Component | |
Component ()=default | |
Constuctor for Component class. More... | |
virtual void | LoadImage (std::string filepath, SDL_Renderer *ren) |
To initalize loadImages for children classes. More... | |
virtual void | HandleEvent (GameEntity &entity) |
Handle the events of GameEntity object for children classes. More... | |
Public Attributes | |
SDL_Rect | rect1 |
SDL_Rect | rect2 |
SDL_Rect | rect3 |
LifeDisplayComponent class used to show character's HP.
LifeDisplayComponent::LifeDisplayComponent | ( | SDL_Renderer * | ren, |
std::string | path | ||
) |
Constuctor for LifeDisplayComponent.
ren | Renderer of the Main Game Loop |
path | Path to the texture to be loaded |
LifeDisplayComponent::~LifeDisplayComponent | ( | ) |
Destructor for LifeDisplayComponent.
|
virtual |
Renders the LifeDisplayComponent.
Renders lives left, based on the number of lives a GameEntity has.
entity | GameEntity Object |
GameEntity | &entity |
Reimplemented from Component.
|
virtual |
Destroys and frees attributes for LifeDisplayComponent.
Reimplemented from Component.
|
virtual |
Initializes the attributes for LifeDisplayComponent.
Reimplemented from Component.
|
virtual |
SDL_Rect LifeDisplayComponent::rect1 |
SDL_Rect LifeDisplayComponent::rect2 |
SDL_Rect LifeDisplayComponent::rect3 |