Changeset 1623 for code/branches/hud/src/orxonox/overlays/OverlayGroup.h
- Timestamp:
- Jun 26, 2008, 1:23:48 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/hud/src/orxonox/overlays/OverlayGroup.h
r1615 r1623 27 27 */ 28 28 29 /** 30 @file 31 @brief Declaration of the OverlayGroup class. 32 */ 33 29 34 #ifndef _OverlayGroup_H__ 30 35 #define _OverlayGroup_H__ … … 39 44 namespace orxonox 40 45 { 46 /** 47 @brief 48 OverlayGroup does almost exactly what it says: It groups OrxonoxOverlays together. 49 You can scroll the entire group by a certain amount. Scale however works differently 50 than expected: Each OrxonoxOverlay scales individually. That's quite useful when you 51 create your HUD with an OverlayGroup and then want to alter its size. 52 */ 41 53 class _OrxonoxExport OverlayGroup : public BaseObject 42 54 { 43 55 public: 44 56 OverlayGroup(); 45 ~OverlayGroup(); 57 //! Empty destructor. 58 ~OverlayGroup() { } 46 59 47 60 void XMLPort(Element& xmlElement, XMLPort::Mode mode); … … 50 63 static void scaleGroup(const std::string& name, float scale); 51 64 static void scrollGroup(const std::string& name, const Vector2& scroll); 52 static void rotateGroup(const std::string& name, Radian angle);53 65 54 66 private: 67 //! Scales each OrxonoxOverlay individually by scale. 55 68 void scale(const Vector2& scale) { this->setScale(scale * this->scale_); } 56 69 void setScale(const Vector2& scale); 70 //! Returns the current size of the group. 57 71 Vector2 getScale() const { return this->scale_; } 58 72 73 //! Scrolls each OrxonoxOverlay individually by scroll. 59 74 void scroll(const Vector2& scroll) { this->setScroll(scroll + this->scroll_); } 60 75 void setScroll(const Vector2& scroll); 76 //! Returns the current scrolling offset of the group. 61 77 Vector2 getScroll() const { return this->scale_; } 62 78 … … 64 80 OrxonoxOverlay* getElement(unsigned int index); 65 81 66 std::map<std::string, OrxonoxOverlay*> hudElements_; 67 Vector2 scale_; 68 Vector2 scroll_; 82 std::map<std::string, OrxonoxOverlay*> hudElements_; //!< Contains all the OrxonoxOverlays of the this group. 83 Vector2 scale_; //!< Current scale (independant of the elements). 84 Vector2 scroll_; //!< Current scrolling offset. 69 85 }; 70 86 }
Note: See TracChangeset
for help on using the changeset viewer.