Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 19, 2008, 9:39:23 PM (17 years ago)
Author:
FelixSchulthess
Message:

edited bar, removed smartbar and replaced functionality with a boolean autoColor to indicate whether the bar should change color automatically

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/hud3/src/orxonox/hud/BarOverlayElement.h

    r1314 r1328  
    2222*      Yuning Chai
    2323*   Co-authors:
    24 *      ...
     24*      Felix Schulthess
    2525*
    2626*/
     
    4343  class _OrxonoxExport BarOverlayElement : public Ogre::PanelOverlayElement
    4444  {
    45   private:
     45    private:
    4646
    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_;
    4951    int left_;
    5052    int top_;
    5153    int width_;
    5254    int height_;
     55    int windowW_, windowH_;
    5356    Ogre::Real leftRel_;
    5457    Ogre::Real topRel_;
    5558    Ogre::Real widthRel_;
    5659    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_;
    8864
    8965    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;
    9075
    91       SmartBarOverlayElement(const Ogre::String& name);
    92       virtual ~SmartBarOverlayElement(void);
    93       virtual void initialise();
     76        BarOverlayElement(const Ogre::String& name);
     77        virtual ~BarOverlayElement();
    9478
    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);
    9783
    98   };
     84        float getValue();
     85        int getBarColor();
     86    };
    9987}
    100 
    10188#endif
    10289
Note: See TracChangeset for help on using the changeset viewer.