FYP  1.0.0
Final Year Project -- Alexander Meuer
gui::HealthBar Class Reference

Healthbar that follows a Pawn's position. More...

#include <HUD.hpp>

Inheritance diagram for gui::HealthBar:
Inheritance graph
Collaboration diagram for gui::HealthBar:
Collaboration graph

Public Member Functions

 HealthBar (std::shared_ptr< Pawn > const &pawnToTrack, sf::Texture *texture, sf::Vector2f const &offset, sf::Vector2f const &size)
 
void update (float deltaSeconds) override
 
- Public Member Functions inherited from gui::HealthBarStatic
 HealthBarStatic (std::shared_ptr< Pawn > const &pawnToTrack, sf::Texture *texture, sf::Vector2f const &position, sf::Vector2f const &size)
 
- Public Member Functions inherited from gui::HudItem
bool isFlaggedForRemoval () const
 

Private Attributes

const sf::Vector2f M_OFFSET
 Displacement from pawn at which to draw the healthbar.
 

Additional Inherited Members

- Protected Member Functions inherited from gui::HealthBarStatic
void draw (sf::RenderTarget &target, sf::RenderStates states) const override
 
- Protected Member Functions inherited from gui::HudItem
void flagForRemoval ()
 
- Protected Attributes inherited from gui::HealthBarStatic
sf::RectangleShape mBar
 Rectangle to represent health.
 
std::weak_ptr< PawnmTracked
 The pawn whose health we're tracking.
 
const float M_MAX_HEALTH
 The amount of health the pawn has when the healthbar was constructed. mBar is scales according to this.
 

Detailed Description

Healthbar that follows a Pawn's position.


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