|
| void | addHealthBar (std::shared_ptr< Pawn > const &pawnToTrack, sf::Vector2f const &offsetOrPosition, sf::Vector2f const &size, sf::Texture *texture=nullptr, bool stationary=false) |
| | Adds a healthbar to the hud. More...
|
| |
| void | addLifeTracker (std::shared_ptr< int > const &livesToTrack, sf::Texture &texture, sf::Vector2f const &position, sf::Vector2f const &scale={1.f, 1.f}, sf::Vector2f const &spacing={0.f, 0.f}) |
| | Adds a series of images to the hud. The number of images reflects the value of a shared int. More...
|
| |
| void | addImage (sf::Texture &texture, sf::Vector2f const &position, sf::Vector2f const &scale={1.f, 1.f}) |
| | Adds an image to the hud. More...
|
| |
| void | addNumberTracker (std::shared_ptr< int > const &number, sf::Vector2f const &position, sf::Font const &font, unsigned int charSize=30u, sf::Vector2f const &scale={1.f, 1.f}) |
| | Adds a number to the hud. More...
|
| |
|
void | update (float deltaSeconds) |
| | Updates all hud items.
|
| |
|
|
void | draw (sf::RenderTarget &target, sf::RenderStates states) const override |
| | Draws all hud items.
|
| |
| void Hud::addHealthBar |
( |
std::shared_ptr< Pawn > const & |
pawnToTrack, |
|
|
sf::Vector2f const & |
offsetOrPosition, |
|
|
sf::Vector2f const & |
size, |
|
|
sf::Texture * |
texture = nullptr, |
|
|
bool |
stationary = false |
|
) |
| |
Adds a healthbar to the hud.
- Parameters
-
| pawnToTrack | The pawn whose health will be displayed by the bar. |
| offsetOrPosition | The offset (for following healthbars) or position (for stationary healthbars) at which to draw the bar. Offset is an offset from the pawn. |
| size | The size of the bar at full health. |
| texture | Texture to draw the bar with. If NULL, will default to solid red. |
| stationary | True if the bar is to be non-moving. (Placed statically on the screen). |
| void Hud::addImage |
( |
sf::Texture & |
texture, |
|
|
sf::Vector2f const & |
position, |
|
|
sf::Vector2f const & |
scale = {1.f, 1.f} |
|
) |
| |
Adds an image to the hud.
- Parameters
-
| texture | Texture to be drawn. |
| position | Upper left corner of image to be drawn. |
| scale | Absolute scale of the image, where {1, 1} is original texture size. |
| void Hud::addLifeTracker |
( |
std::shared_ptr< int > const & |
livesToTrack, |
|
|
sf::Texture & |
texture, |
|
|
sf::Vector2f const & |
position, |
|
|
sf::Vector2f const & |
scale = {1.f, 1.f}, |
|
|
sf::Vector2f const & |
spacing = {0.f, 0.f} |
|
) |
| |
Adds a series of images to the hud. The number of images reflects the value of a shared int.
- Parameters
-
| livesToTrack | Shared pointer to the number of images to draw. (e.g. Lives, Deaths, Potions...) |
| position | The upper left corner of the first image. This is the anchor. |
| scale | How much to scale the image by. All images will be drawn the same size, this is an overall scale. |
| spacing | The space between each image. This is measured from the top left of the last image drawn. |
| void Hud::addNumberTracker |
( |
std::shared_ptr< int > const & |
number, |
|
|
sf::Vector2f const & |
position, |
|
|
sf::Font const & |
font, |
|
|
unsigned int |
charSize = 30u, |
|
|
sf::Vector2f const & |
scale = {1.f, 1.f} |
|
) |
| |
Adds a number to the hud.
- Parameters
-
| number | Shared number to be displayed |
| position | Location of number of screen (upper left corner). |
| font | The font to use for the text. |
| charSize | The character size of the text. |
| scale | How much the scale the text by. |
The documentation for this class was generated from the following file: