#include <src/orxonox/overlays/OverlayGroup.h>
Public Member Functions | |
void | addElement (OrxonoxOverlay *element) |
Adds an element to the set (used when loading with XMLPort). | |
void | changedVisibility () |
Changes the visibility of all elements. | |
OrxonoxOverlay * | getElement (unsigned int index) |
Returns a different element as long as index < hudElements_.size(). | |
const std::set< OrxonoxOverlay * > & | getOverlays () const |
BaseObject * | getOwner () const |
Vector2 | getScale () const |
Returns the current size of the group. | |
Vector2 | getScroll () const |
Returns the current scrolling offset of the group. | |
OverlayGroup (BaseObject *creator) | |
bool | removeElement (OrxonoxOverlay *element) |
Removes an element from the map. | |
void | scale (const Vector2 &scale) |
Scales each OrxonoxOverlay individually by scale. | |
void | scroll (const Vector2 &scroll) |
Scrolls each OrxonoxOverlay individually by scroll. | |
void | setOwner (BaseObject *owner) |
void | setScale (const Vector2 &scale) |
Scales every element in the set. | |
void | setScroll (const Vector2 &scroll) |
Scrolls every element in the set. | |
virtual void | XMLPort (Element &xmlElement, XMLPort::Mode mode) |
Loads the group and all its children OrxonoxOverlays. | |
~OverlayGroup () | |
Empty destructor. | |
Static Public Member Functions | |
static void | scaleGroup (const std::string &name, float scale) |
Scales an overlay group by its name. | |
static void | scrollGroup (const std::string &name, const Vector2 &scroll) |
Scrolls an overlay group by its name. | |
static void | toggleVisibility (const std::string &name) |
Hides/shows an overlay group by its name. | |
Private Attributes | |
std::set< OrxonoxOverlay * > | hudElements_ |
Contains all the OrxonoxOverlays of the this group. | |
BaseObject * | owner_ |
The owner of this OverlayGroup. | |
Vector2 | scale_ |
Current scale (independent of the elements). | |
Vector2 | scroll_ |
Current scrolling offset. |
orxonox::OverlayGroup::OverlayGroup | ( | BaseObject * | creator | ) |
orxonox::OverlayGroup::~OverlayGroup | ( | ) |
void orxonox::OverlayGroup::addElement | ( | OrxonoxOverlay * | element | ) |
Adds an element to the set (used when loading with XMLPort).
References hudElements_, orxonox::BaseObject::isVisible(), owner_, orxonox::OrxonoxOverlay::setOwner(), and orxonox::BaseObject::setVisible().
Referenced by orxonox::NotificationQueue::addNotification(), orxonox::HUDHealthBar::changedOverlayGroup(), and XMLPort().
void orxonox::OverlayGroup::changedVisibility | ( | ) | [virtual] |
Changes the visibility of all elements.
Reimplemented from orxonox::BaseObject.
References hudElements_.
OrxonoxOverlay * orxonox::OverlayGroup::getElement | ( | unsigned int | index | ) |
Returns a different element as long as index < hudElements_.size().
References hudElements_.
Referenced by XMLPort().
const std::set<OrxonoxOverlay*>& orxonox::OverlayGroup::getOverlays | ( | ) | const [inline] |
BaseObject* orxonox::OverlayGroup::getOwner | ( | ) | const [inline] |
Vector2 orxonox::OverlayGroup::getScale | ( | ) | const [inline] |
Vector2 orxonox::OverlayGroup::getScroll | ( | ) | const [inline] |
bool orxonox::OverlayGroup::removeElement | ( | OrxonoxOverlay * | element | ) |
Removes an element from the map.
name | The name of the element that is removed. |
References hudElements_.
Referenced by orxonox::NotificationQueue::removeContainer().
void orxonox::OverlayGroup::scale | ( | const Vector2 & | scale | ) | [inline] |
Scales each OrxonoxOverlay individually by scale.
void orxonox::OverlayGroup::scaleGroup | ( | const std::string & | name, | |
float | scale | |||
) | [static] |
Scales an overlay group by its name.
name | The name of the group defined BaseObject::setName() (usually done with the "name" attribute in the xml file). |
References orxonox::MT_Type::Vector2.
void orxonox::OverlayGroup::scroll | ( | const Vector2 & | scroll | ) | [inline] |
Scrolls each OrxonoxOverlay individually by scroll.
void orxonox::OverlayGroup::scrollGroup | ( | const std::string & | name, | |
const Vector2 & | scroll | |||
) | [static] |
Scrolls an overlay group by its name.
name | The name of the group defined BaseObject::setName() (usually done with the "name" attribute in the xml file). |
void orxonox::OverlayGroup::setOwner | ( | BaseObject * | owner | ) |
References hudElements_, and owner_.
Referenced by orxonox::ControllableEntity::startLocalHumanControl(), orxonox::HumanPlayer::updateGametypeHUD(), and orxonox::HumanPlayer::updateHumanHUD().
void orxonox::OverlayGroup::setScale | ( | const Vector2 & | scale | ) |
void orxonox::OverlayGroup::setScroll | ( | const Vector2 & | scroll | ) |
void orxonox::OverlayGroup::toggleVisibility | ( | const std::string & | name | ) | [static] |
Hides/shows an overlay group by its name.
name | The name of the group defined BaseObject::setName() (usually done with the "name" attribute in the xml file). |
void orxonox::OverlayGroup::XMLPort | ( | Element & | xmlElement, | |
XMLPort::Mode | mode | |||
) | [virtual] |
Loads the group and all its children OrxonoxOverlays.
XML loading and saving.
xmlelement | The XML-element | |
loading | Loading (true) or saving (false) |
Reimplemented from orxonox::BaseObject.
Reimplemented in orxonox::NotificationQueue.
References addElement(), getElement(), getScale(), getScroll(), setScale(), setScroll(), SUPER, XMLPortObject, and XMLPortParam.
std::set<OrxonoxOverlay*> orxonox::OverlayGroup::hudElements_ [private] |
Contains all the OrxonoxOverlays of the this group.
Referenced by addElement(), changedVisibility(), getElement(), removeElement(), setOwner(), setScale(), setScroll(), and ~OverlayGroup().
BaseObject* orxonox::OverlayGroup::owner_ [private] |
Vector2 orxonox::OverlayGroup::scale_ [private] |
Vector2 orxonox::OverlayGroup::scroll_ [private] |