Changeset 991 for code/branches/hud2/src
- Timestamp:
- Apr 4, 2008, 12:10:58 PM (17 years ago)
- Location:
- code/branches/hud2/src/orxonox
- Files:
-
- 8 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/hud2/src/orxonox/CMakeLists.txt
r971 r991 5 5 # SpaceshipSteering.cc 6 6 hud/HUD.cc 7 hud/Bar.cc 7 8 particle/ParticleInterface.cc 8 9 tools/BillboardSet.cc … … 46 47 ) 47 48 49 -
code/branches/hud2/src/orxonox/Orxonox.cc
r973 r991 255 255 bulletMgr_ = new BulletManager(); 256 256 257 Ogre::Overlay* hudOverlay = Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2");258 HUD* orxonoxHud;259 orxonoxH ud = new HUD();260 orxonoxHud->setEnergyValue(20);261 orxonoxHud->setEnergyDistr(20,20,60);262 hudOverlay->show();257 //Ogre::Overlay* hudOverlay = Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2"); 258 //HUD* orxonoxHud; 259 orxonoxHUD_ = new HUD(1); 260 //orxonoxHud->setEnergyValue(20); 261 //orxonoxHud->setEnergyDistr(20,20,60); 262 //hudOverlay->show(); 263 263 264 264 client_g->establishConnection(); … … 306 306 Loader::open(startlevel); 307 307 308 Ogre::Overlay* hudOverlay = Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2");309 orxonoxHUD_ = new HUD( );310 orxonoxHUD_->setEnergyValue(20);311 orxonoxHUD_->setEnergyDistr(20,20,60);312 hudOverlay->show();308 //Ogre::Overlay* hudOverlay = Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2"); 309 orxonoxHUD_ = new HUD(1); 310 //orxonoxHUD_->setEnergyValue(20); 311 //orxonoxHUD_->setEnergyDistr(20,20,60); 312 //hudOverlay->show(); 313 313 314 314 /* … … 374 374 375 375 // show the current time in the HUD 376 orxonoxHUD_->setTime((int)now, 0); 376 //orxonoxHUD_->setTime((int)now, 0); 377 orxonoxHUD_->energyCounter->reset(20); 378 377 379 378 380 // Iterate through all Tickables and call their tick(dt) function -
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 */ -
code/branches/hud2/src/orxonox/hud/HUD.h
r790 r991 26 26 */ 27 27 28 28 29 #ifndef _HUD_H__ 30 #define _HUD_H__ 31 32 #include <string.h> 33 #include <OgreOverlayElement.h> 34 #include <OgreTextAreaOverlayElement.h> 35 #include <OgrePrerequisites.h> 36 #include "../OrxonoxPrereqs.h" 37 38 #include "Bar.h" 39 40 41 namespace orxonox 42 { 43 class _OrxonoxExport HUD 44 { 45 private: 46 47 public: 48 HUD(int zoom); 49 ~HUD(); 50 51 Bar* energyCounter; 52 }; 53 } 54 55 56 57 58 59 60 61 62 63 #endif _HUD_H_ 64 65 /*#ifndef _HUD_H__ 29 66 #define _HUD_H__ 30 67
Note: See TracChangeset
for help on using the changeset viewer.