Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 4, 2008, 12:10:58 PM (17 years ago)
Author:
rgrieder
Message:
  • added the hud files and edited the CMLs
File:
1 edited

Legend:

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

    r790 r991  
    2626*/
    2727
     28
    2829#include "OrxonoxStableHeaders.h"
     30#include <OgreOverlay.h>
     31#include <OgreOverlayContainer.h>
     32#include <OgreOverlayManager.h>
     33
     34#include "HUD.h"
     35#include "Bar.h"
     36
     37
     38namespace orxonox
     39{
     40  using namespace Ogre;
     41
     42
     43
     44
     45
     46  HUD::HUD(int zoom){
     47
     48    Ogre::OverlayManager& overlayManager = Ogre::OverlayManager::getSingleton();
     49
     50    energyCounter = new Bar(0,0,100,20,Bar::LEFT,Bar::YELLOW,"Orxonox/HUD/energyCounterPanel/energyCounter");
     51
     52    Ogre::OverlayContainer* energyCounterPanel = static_cast<Ogre::OverlayContainer*>(overlayManager.createOverlayElement("Panel", "Orxonox/HUD/energyCounterPanel"));
     53    energyCounterPanel->setLeft(-50);
     54    energyCounterPanel->setTop(10);
     55    energyCounterPanel->setWidth(100);
     56    energyCounterPanel->setHeight(20);
     57    energyCounterPanel->setHorizontalAlignment(Ogre::GHA_CENTER);
     58    energyCounterPanel->setMetricsMode(Ogre::GMM_PIXELS);       
     59    energyCounterPanel->show();
     60    energyCounterPanel->addChild(energyCounter->element);
     61
     62    Ogre::Overlay* orxonoxOverlay = overlayManager.create("Orxonox/HUD");
     63    orxonoxOverlay->add2D(energyCounterPanel);
     64    orxonoxOverlay->show();
     65  }
     66
     67  HUD::~HUD(void){}
     68
     69
     70
     71}
     72
     73
     74
     75
     76
     77
     78/*#include "OrxonoxStableHeaders.h"
    2979
    3080#include <OgreOverlayManager.h>
     
    3383
    3484#include "HUD.h"
    35 
     85#include "Bar.h"
    3686
    3787namespace orxonox
     
    50100    setTargetWindowDistance(30);
    51101
    52     setEnergyValue(60.0);
     102    setEnergyValue(60);
    53103
    54104    setShieldLeftTopValue(true);
     
    68118    energyDistrPixelX_ = 100;
    69119    energyDistrPixelY_ = 86;
     120
    70121
    71122  }
     
    217268
    218269}
     270*/
Note: See TracChangeset for help on using the changeset viewer.