#include <src/orxonox/overlays/hud/HUDBar.h>
Public Member Functions | |
void | clearColours () |
bool | getAutoColour () const |
const std::string & | getBarTexture () const |
const ColourValue & | getCurrentBarColour () const |
bool | getRightToLeft () const |
float | getValue () const |
HUDBar (BaseObject *creator) | |
void | setAutoColour (bool val) |
void | setBarTexture (const std::string &texture) |
void | setRightToLeft (bool r2l) |
void | setValue (float value) |
virtual void | XMLPort (Element &xmlElement, XMLPort::Mode mode) |
Loads the OrxonoxOverlay. | |
virtual | ~HUDBar () |
Protected Member Functions | |
virtual void | valueChanged () |
Private Member Functions | |
void | addColour (BarColour *colour) |
BarColour * | getColour (unsigned int index) |
Private Attributes | |
bool | autoColour_ |
whether bar changes colour automatically | |
Ogre::PanelOverlayElement * | bar_ |
std::vector< BarColour * > | barColours_ |
std::map< float, ColourValue > | colours_ |
ColourValue | currentColour_ |
bool | right2Left_ |
Ogre::TextureUnitState * | textureUnitState_ |
float | value_ |
progress of bar | |
Static Private Attributes | |
static unsigned int | materialcount_s = 0 |
orxonox::HUDBar::HUDBar | ( | BaseObject * | creator | ) |
orxonox::HUDBar::~HUDBar | ( | ) | [virtual] |
References bar_, and orxonox::BaseObject::isInitialized().
void orxonox::HUDBar::addColour | ( | BarColour * | colour | ) | [private] |
References barColours_, colours_, orxonox::BarColour::getColour(), and orxonox::BarColour::getPosition().
Referenced by XMLPort().
void orxonox::HUDBar::clearColours | ( | ) |
References colours_.
bool orxonox::HUDBar::getAutoColour | ( | ) | const [inline] |
Referenced by XMLPort().
const std::string & orxonox::HUDBar::getBarTexture | ( | ) | const |
BarColour * orxonox::HUDBar::getColour | ( | unsigned int | index | ) | [private] |
const ColourValue& orxonox::HUDBar::getCurrentBarColour | ( | ) | const [inline] |
Referenced by orxonox::HUDHealthBar::tick().
bool orxonox::HUDBar::getRightToLeft | ( | ) | const [inline] |
Referenced by XMLPort().
float orxonox::HUDBar::getValue | ( | ) | const [inline] |
Referenced by XMLPort().
void orxonox::HUDBar::setBarTexture | ( | const std::string & | texture | ) |
void orxonox::HUDBar::setValue | ( | float | value | ) | [inline] |
References orxonox::clamp().
Referenced by HUDBar(), orxonox::HUDSpeedBar::tick(), orxonox::HUDHealthBar::tick(), and XMLPort().
void orxonox::HUDBar::valueChanged | ( | ) | [protected, virtual] |
References autoColour_, bar_, colours_, orxonox::MT_Type::ColourValue, currentColour_, orxonox::interpolateSmooth(), right2Left_, textureUnitState_, and value_.
void orxonox::HUDBar::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.
xmlelement | The XML-element | |
loading | Loading (true) or saving (false) |
Reimplemented from orxonox::OrxonoxOverlay.
Reimplemented in orxonox::HUDHealthBar, and orxonox::UnderAttackHealthBar.
References addColour(), getAutoColour(), getBarTexture(), getColour(), getRightToLeft(), getValue(), setAutoColour(), setBarTexture(), setRightToLeft(), setValue(), SUPER, XMLPortObject, and XMLPortParam.
bool orxonox::HUDBar::autoColour_ [private] |
Ogre::PanelOverlayElement* orxonox::HUDBar::bar_ [private] |
Referenced by HUDBar(), valueChanged(), and ~HUDBar().
std::vector<BarColour*> orxonox::HUDBar::barColours_ [private] |
Referenced by addColour(), and getColour().
std::map<float, ColourValue> orxonox::HUDBar::colours_ [private] |
Referenced by addColour(), clearColours(), and valueChanged().
ColourValue orxonox::HUDBar::currentColour_ [private] |
Referenced by HUDBar(), and valueChanged().
unsigned int orxonox::HUDBar::materialcount_s = 0 [static, private] |
Referenced by HUDBar().
bool orxonox::HUDBar::right2Left_ [private] |
Referenced by valueChanged().
Ogre::TextureUnitState* orxonox::HUDBar::textureUnitState_ [private] |
Referenced by getBarTexture(), HUDBar(), setBarTexture(), and valueChanged().
float orxonox::HUDBar::value_ [private] |