Changeset 1623 for code/branches/hud/src/orxonox/overlays/OverlayGroup.cc
- Timestamp:
- Jun 26, 2008, 1:23:48 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/hud/src/orxonox/overlays/OverlayGroup.cc
r1616 r1623 27 27 */ 28 28 29 /** 30 @file 31 @brief Definition of the OverlayGroup class. 32 */ 33 29 34 #include "OrxonoxStableHeaders.h" 30 35 #include "OverlayGroup.h" … … 45 50 46 51 OverlayGroup::OverlayGroup() 47 : scale_(1.0, 1.0)48 52 { 49 53 RegisterObject(OverlayGroup); 50 54 } 51 55 52 OverlayGroup::~OverlayGroup() 53 { 54 } 55 56 /** 57 @brief 58 Loads the group and all its children OrxonoxOverlays. 59 @copydoc 60 BaseObject::XMLPort() 61 */ 56 62 void OverlayGroup::XMLPort(Element& xmlElement, XMLPort::Mode mode) 57 63 { 58 64 BaseObject::XMLPort(xmlElement, mode); 59 65 66 if (mode == XMLPort::LoadObject) 67 { 68 // set default values 69 this->scale_ = Vector2(1.0, 1.0); 70 this->scroll_ = Vector2(0.0, 0.0); 71 } 72 60 73 XMLPortParam(OverlayGroup, "scale", setScale, getScale, xmlElement, mode); 61 74 XMLPortParam(OverlayGroup, "scroll", setScroll, getScroll, xmlElement, mode); 75 // loads all the child elements 62 76 XMLPortObject(OverlayGroup, OrxonoxOverlay, "", addElement, getElement, xmlElement, mode, false, true); 63 77 } 64 78 79 //! Scales every element in the map. 65 80 void OverlayGroup::setScale(const Vector2& scale) 66 81 { … … 70 85 } 71 86 87 //! Scrolls every element in the map. 72 88 void OverlayGroup::setScroll(const Vector2& scroll) 73 89 { … … 77 93 } 78 94 95 /** 96 @brief 97 Adds an element to the map (used when loading with XMLPort). 98 @remarks 99 The names of the OrxonoxOverlays have to be unique! 100 */ 79 101 void OverlayGroup::addElement(OrxonoxOverlay* element) 80 102 { … … 87 109 } 88 110 111 //! Returns a different element as long as index < hudElements_.size(). 89 112 OrxonoxOverlay* OverlayGroup::getElement(unsigned int index) 90 113 { … … 101 124 102 125 126 //########### Console commands ############ 127 128 /** 129 @brief 130 Hides/shows an overlay group by its name. 131 @param name 132 The name of the group defined BaseObject::setName() (usually done with the "name" 133 attribute in the xml file). 134 */ 103 135 /*static*/ void OverlayGroup::toggleVisibility(const std::string& name) 104 136 { … … 110 142 } 111 143 144 /** 145 @brief 146 Scales an overlay group by its name. 147 @param name 148 The name of the group defined BaseObject::setName() (usually done with the "name" 149 attribute in the xml file). 150 */ 112 151 /*static*/ void OverlayGroup::scaleGroup(const std::string& name, float scale) 113 152 { … … 119 158 } 120 159 160 /** 161 @brief 162 Scrolls an overlay group by its name. 163 @param name 164 The name of the group defined BaseObject::setName() (usually done with the "name" 165 attribute in the xml file). 166 */ 121 167 /*static*/ void OverlayGroup::scrollGroup(const std::string& name, const Vector2& scroll) 122 168 {
Note: See TracChangeset
for help on using the changeset viewer.