Orxonox: orxonox::HUDHealthBar Class Reference

# orxonox::HUDHealthBar Class Reference

`#include <src/orxonox/overlays/hud/HUDHealthBar.h>`

Inheritance diagram for orxonox::HUDHealthBar:

List of all members.

## Public Member Functions

virtual void | changedName ()
| This function gets called if the name of the object changes.
virtual void | changedOverlayGroup ()
virtual void | changedOwner ()
virtual void | changedVisibility ()
| Called by BaseObject when visibility has changed.
OverlayText::Alignment | getTextAlignment () const
std::string | getTextAlignmentString () const
bool | getTextAspectCorrection () const
const ColourValue & | getTextColour () const
const std::string & | getTextFont () const
Vector2 | getTextOffset () const
Vector2 | getTextPickPoint () const
const Degree & | getTextRotation () const
float | getTextSize () const
float | getTextSpaceWidth () const
bool | getTextUseBarColour () const
bool | getTextVisible () const
| HUDHealthBar (BaseObject *creator)
void | setTextAlignment (OverlayText::Alignment alignment)
void | setTextAlignmentString (const std::string &alignment)
void | setTextAspectCorrection (bool correct)
void | setTextColour (const ColourValue &colour)
void | setTextFont (const std::string &font)
void | setTextOffset (const Vector2 &position)
void | setTextPickPoint (const Vector2 &pickpoint)
void | setTextRotation (const Degree &angle)
void | setTextSize (float size)
void | setTextSpaceWidth (float width)
void | setTextUseBarColour (bool bUseBarColour)
void | setTextVisible (bool bVisible)
virtual void | tick (float dt)
| Gets called every frame.
virtual void | XMLPort (Element &xmlElement, XMLPort::Mode mode)
| Loads the OrxonoxOverlay.
virtual | ~HUDHealthBar ()

## Private Attributes

bool | bUseBarColour_
Pawn * | owner_
ColourValue | textColour_
OverlayText * | textoverlay_

## Constructor & Destructor Documentation

orxonox::HUDHealthBar::HUDHealthBar | ( | BaseObject * | creator | ) |

References bUseBarColour_, owner_, RegisterObject, orxonox::OverlayText::setCaption(), and textoverlay_.

orxonox::HUDHealthBar::~HUDHealthBar | ( |  | ) | `[virtual]`

References orxonox::BaseObject::isInitialized(), and textoverlay_.

## Member Function Documentation

void orxonox::HUDHealthBar::changedName | ( |  | ) | `[virtual]`

This function gets called if the name of the object changes.

Reimplemented from orxonox::OrxonoxOverlay.

References orxonox::BaseObject::getName(), orxonox::BaseObject::setName(), SUPER, and textoverlay_.

void orxonox::HUDHealthBar::changedOverlayGroup | ( |  | ) | `[virtual]`

Reimplemented from orxonox::OrxonoxOverlay.

References orxonox::OverlayGroup::addElement(), orxonox::OrxonoxOverlay::getOverlayGroup(), SUPER, and textoverlay_.

void orxonox::HUDHealthBar::changedOwner | ( |  | ) | `[virtual]`

Reimplemented from orxonox::OrxonoxOverlay.

Reimplemented in orxonox::UnderAttackHealthBar.

References orxonox::OrxonoxOverlay::getOwner(), owner_, and SUPER.

void orxonox::HUDHealthBar::changedVisibility | ( |  | ) | `[virtual]`

Called by BaseObject when visibility has changed.

Reimplemented from orxonox::OrxonoxOverlay.

References orxonox::BaseObject::isVisible(), orxonox::BaseObject::setVisible(), SUPER, and textoverlay_.

OverlayText::Alignment orxonox::HUDHealthBar::getTextAlignment | ( |  | ) | const`[inline]`

std::string orxonox::HUDHealthBar::getTextAlignmentString | ( |  | ) | const`[inline]`

Referenced by XMLPort().

bool orxonox::HUDHealthBar::getTextAspectCorrection | ( |  | ) | const`[inline]`

Referenced by XMLPort().

const ColourValue& orxonox::HUDHealthBar::getTextColour | ( |  | ) | const`[inline]`

Referenced by XMLPort().

const std::string& orxonox::HUDHealthBar::getTextFont | ( |  | ) | const`[inline]`

Referenced by XMLPort().

Vector2 orxonox::HUDHealthBar::getTextOffset | ( |  | ) | const`[inline]`

Referenced by XMLPort().

Vector2 orxonox::HUDHealthBar::getTextPickPoint | ( |  | ) | const`[inline]`

Referenced by XMLPort().

const Degree& orxonox::HUDHealthBar::getTextRotation | ( |  | ) | const`[inline]`

Referenced by XMLPort().

float orxonox::HUDHealthBar::getTextSize | ( |  | ) | const`[inline]`

Referenced by XMLPort().

float orxonox::HUDHealthBar::getTextSpaceWidth | ( |  | ) | const`[inline]`

Referenced by XMLPort().

bool orxonox::HUDHealthBar::getTextUseBarColour | ( |  | ) | const`[inline]`

Referenced by XMLPort().

bool orxonox::HUDHealthBar::getTextVisible | ( |  | ) | const`[inline]`

Referenced by XMLPort().

void orxonox::HUDHealthBar::setTextAlignment | ( | OverlayText::Alignment | alignment | ) | `[inline]`

void orxonox::HUDHealthBar::setTextAlignmentString | ( | const std::string & | alignment | ) | `[inline]`

Referenced by XMLPort().

void orxonox::HUDHealthBar::setTextAspectCorrection | ( | bool | correct | ) | `[inline]`

Referenced by XMLPort().

void orxonox::HUDHealthBar::setTextColour | ( | const ColourValue & | colour | ) |

References bUseBarColour_, orxonox::OverlayText::setColour(), textColour_, and textoverlay_.

Referenced by XMLPort().

void orxonox::HUDHealthBar::setTextFont | ( | const std::string & | font | ) | `[inline]`

Referenced by XMLPort().

void orxonox::HUDHealthBar::setTextOffset | ( | const Vector2 & | position | ) | `[inline]`

Referenced by XMLPort().

void orxonox::HUDHealthBar::setTextPickPoint | ( | const Vector2 & | pickpoint | ) | `[inline]`

Referenced by XMLPort().

void orxonox::HUDHealthBar::setTextRotation | ( | const Degree & | angle | ) | `[inline]`

Referenced by XMLPort().

void orxonox::HUDHealthBar::setTextSize | ( | float | size | ) | `[inline]`

Referenced by XMLPort().

void orxonox::HUDHealthBar::setTextSpaceWidth | ( | float | width | ) | `[inline]`

Referenced by XMLPort().

void orxonox::HUDHealthBar::setTextUseBarColour | ( | bool | bUseBarColour | ) |

References bUseBarColour_, orxonox::OverlayText::setColour(), textColour_, and textoverlay_.

Referenced by XMLPort().

void orxonox::HUDHealthBar::setTextVisible | ( | bool | bVisible | ) | `[inline]`

Referenced by XMLPort().

void orxonox::HUDHealthBar::tick | ( | float | dt | ) | `[virtual]`

Gets called every frame.

Parameters:

  | dt | The time since the last frame in seconds

Implements orxonox::Tickable.

References bUseBarColour_, orxonox::HUDBar::getCurrentBarColour(), orxonox::Pawn::getHealth(), orxonox::Pawn::getInitialHealth(), owner_, orxonox::OverlayText::setCaption(), orxonox::OverlayText::setColour(), orxonox::HUDBar::setValue(), SUPER, and textoverlay_.

void orxonox::HUDHealthBar::XMLPort | ( | Element & | xmlElement,
|  | XMLPort::Mode | mode |
| ) |  |  | `[virtual]`

Loads the OrxonoxOverlay.

This has to be called before usage, otherwise strange behaviour is guaranteed! (there should be no segfaults however). XML loading and saving.

Parameters:

  | xmlelement | The XML-element
  | loading | Loading (true) or saving (false)

Returns:
  The XML-element

Reimplemented from orxonox::HUDBar.

Reimplemented in orxonox::UnderAttackHealthBar.

References orxonox::MT_Type::ColourValue, getTextAlignmentString(), getTextAspectCorrection(), getTextColour(), getTextFont(), getTextOffset(), getTextPickPoint(), getTextRotation(), getTextSize(), getTextSpaceWidth(), getTextUseBarColour(), getTextVisible(), setTextAlignmentString(), setTextAspectCorrection(), setTextColour(), setTextFont(), setTextOffset(), setTextPickPoint(), setTextRotation(), setTextSize(), setTextSpaceWidth(), setTextUseBarColour(), setTextVisible(), SUPER, and XMLPortParam.

## Member Data Documentation

bool orxonox::HUDHealthBar::bUseBarColour_`[private]`

Referenced by HUDHealthBar(), setTextColour(), setTextUseBarColour(), and tick().

Pawn* orxonox::HUDHealthBar::owner_`[private]`

Reimplemented from orxonox::OrxonoxOverlay.

Reimplemented in orxonox::UnderAttackHealthBar.

Referenced by changedOwner(), HUDHealthBar(), and tick().

ColourValue orxonox::HUDHealthBar::textColour_`[private]`

Referenced by setTextColour(), and setTextUseBarColour().

OverlayText* orxonox::HUDHealthBar::textoverlay_`[private]`

Referenced by changedName(), changedOverlayGroup(), changedVisibility(), HUDHealthBar(), setTextColour(), setTextUseBarColour(), tick(), and ~HUDHealthBar().

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

- src/orxonox/overlays/hud/HUDHealthBar.h
- src/orxonox/overlays/hud/HUDHealthBar.cc