Changeset 1328 for code/branches/hud3/src/orxonox/hud/BarOverlayElement.h
- Timestamp:
- May 19, 2008, 9:39:23 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/hud3/src/orxonox/hud/BarOverlayElement.h
r1314 r1328 22 22 * Yuning Chai 23 23 * Co-authors: 24 * ...24 * Felix Schulthess 25 25 * 26 26 */ … … 43 43 class _OrxonoxExport BarOverlayElement : public Ogre::PanelOverlayElement 44 44 { 45 private:45 private: 46 46 47 int percentage_; 48 int dir_; 47 bool autoColor_; // whether bar changes color automatically 48 float value_; // progress of bar 49 int dir_; // direction of progress 50 int color_; 49 51 int left_; 50 52 int top_; 51 53 int width_; 52 54 int height_; 55 int windowW_, windowH_; 53 56 Ogre::Real leftRel_; 54 57 Ogre::Real topRel_; 55 58 Ogre::Real widthRel_; 56 59 Ogre::Real heightRel_; 57 int windowW_, windowH_; 58 59 static Ogre::String& typeName_s; 60 61 public: 62 63 static const int LEFT = 0; 64 static const int UP = 1; 65 static const int RIGHT = 2; 66 static const int DOWN = 3; 67 68 static const int RED = 0; 69 static const int YELLOW = 1; 70 static const int GREEN = 2; 71 72 BarOverlayElement(const Ogre::String& name); 73 virtual ~BarOverlayElement(); 74 virtual void initialise(); 75 76 void initBarOverlayElement(Real leftRel, Real topRel, Real widthRel, Real heightRel, 77 int dir, int colour); 78 79 void reset(int percentage); 80 void setColour(int colour); 81 82 }; 83 84 85 class _OrxonoxExport SmartBarOverlayElement : public BarOverlayElement 86 { 87 private: 60 Ogre::PanelOverlayElement* bar_; // the actual bar 61 Ogre::OverlayManager* om; // our overlay manager 62 Ogre::OverlayContainer* container_; // our parent container to attach to 63 Ogre::String name_; 88 64 89 65 public: 66 // directions 67 static const int RIGHT = 0; 68 static const int UP = 1; 69 static const int LEFT = 2; 70 static const int DOWN = 3; 71 // predefined colors 72 static const int RED = 0; 73 static const int YELLOW = 1; 74 static const int GREEN = 2; 90 75 91 SmartBarOverlayElement(const Ogre::String& name); 92 virtual ~SmartBarOverlayElement(void); 93 virtual void initialise(); 76 BarOverlayElement(const Ogre::String& name); 77 virtual ~BarOverlayElement(); 94 78 95 void initSmartBarOverlayElement(Ogre::Real left, Ogre::Real top, Ogre::Real width, Ogre::Real height, int dir); 96 void reset(int percentage); 79 void init(Real leftRel, Real topRel, Real widthRel, Real heightRel, Ogre::OverlayContainer* container); 80 void setDir(int dir); 81 void setValue(float value); 82 void setColor(int color); 97 83 98 }; 84 float getValue(); 85 int getBarColor(); 86 }; 99 87 } 100 101 88 #endif 102 89
Note: See TracChangeset
for help on using the changeset viewer.