Changeset 991 for code/branches/hud2/src/orxonox/hud/HUD.cc
- Timestamp:
- Apr 4, 2008, 12:10:58 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/hud2/src/orxonox/hud/HUD.cc
r790 r991 26 26 */ 27 27 28 28 29 #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 38 namespace 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" 29 79 30 80 #include <OgreOverlayManager.h> … … 33 83 34 84 #include "HUD.h" 35 85 #include "Bar.h" 36 86 37 87 namespace orxonox … … 50 100 setTargetWindowDistance(30); 51 101 52 setEnergyValue(60 .0);102 setEnergyValue(60); 53 103 54 104 setShieldLeftTopValue(true); … … 68 118 energyDistrPixelX_ = 100; 69 119 energyDistrPixelY_ = 86; 120 70 121 71 122 } … … 217 268 218 269 } 270 */
Note: See TracChangeset
for help on using the changeset viewer.