Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 11, 2008, 12:21:42 AM (16 years ago)
Author:
rgrieder
Message:
  • added XML loadable HUD
  • Radar and navi are not yet done
  • explanations follow with when things are finished
File:
1 edited

Legend:

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

    r1567 r1588  
    3535#include <OgrePrerequisites.h>
    3636#include <OgreTextAreaOverlayElement.h>
     37#include "core/BaseObject.h"
    3738#include "objects/Tickable.h"
    3839#include "util/Math.h"
     
    4142namespace orxonox
    4243{
    43     class _OrxonoxExport HUD : public TickableReal
     44    class HUDBar;
     45    class HUDOverlay;
     46
     47    class _OrxonoxExport HUD : public BaseObject, public TickableReal
    4448    {
    4549      public:
    46         void initialise();
    47         void destroy();
     50        HUD();
     51        ~HUD();
     52
     53        virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
    4854
    4955        virtual void tick(float);
     
    5258        void addRadarObject(WorldEntity* object, const ColourValue& colour = ColourValue(0.5, 0.5, 0.5, 1));
    5359        void removeRadarObject(WorldEntity* object);
    54         void setRenderTimeRatio(float ratio);
    5560        void setFPS();
    5661
     
    6368        static void cycleNavigationFocus();
    6469        static void releaseNavigationFocus();
    65         static void toggleFPS();
    66         static void toggleRenderTime();
     70        static void toggleVisibility(const std::string& name);
    6771
    6872      private:
    69         HUD();
    7073        HUD(const HUD& instance);
    71         ~HUD();
     74
     75        void addHUDElement(HUDOverlay* element);
     76        HUDOverlay* getHUDElement(unsigned int index);
     77
     78        std::map<std::string, HUDOverlay*> hudElements_;
    7279
    7380        std::list<RadarObject*> roSet_;
    74         BarOverlayElementFactory barOverlayElementFactory_;
     81
    7582        RadarOverlayElementFactory radarOverlayElementFactory_;
    7683
     
    7986        Ogre::TextAreaOverlayElement* fpsText_;
    8087        Ogre::TextAreaOverlayElement* rTRText_;
    81         BarOverlayElement* energyBar_;
     88        HUDBar* energyBar_;
    8289        BarOverlayElement* speedoBar_;
    8390        RadarOverlayElement* radar_;
     
    8693        bool showFPS_;
    8794        bool showRenderTime_;
     95
     96        static HUD* instance_s;
    8897    };
    8998}
Note: See TracChangeset for help on using the changeset viewer.