Changeset 823 for code/branches/hud/src/orxonox/Orxonox.cc
- Timestamp:
- Feb 17, 2008, 5:42:44 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/hud/src/orxonox/Orxonox.cc
r790 r823 43 43 #include <OgreConfigFile.h> 44 44 #include <OgreOverlay.h> 45 #include <OgreOverlayContainer.h> 45 46 #include <OgreOverlayManager.h> 46 47 … … 73 74 #include "core/Debug.h" 74 75 #include "hud/HUD.h" 76 #include "hud/Bar.h" 75 77 #include "objects/weapon/BulletManager.h" 76 78 #include "GraphicsEngine.h" … … 382 384 loader_->loadLevel(); 383 385 384 Ogre::Overlay* hudOverlay = Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2"); 385 HUD* orxonoxHud; 386 orxonoxHud = new HUD(); 387 orxonoxHud->setEnergyValue(20); 388 orxonoxHud->setEnergyDistr(20,20,60); 386 // Ogre::Overlay* hudOverlay = Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2"); 387 // Ogre::OverlayContainer* cont = Ogre::OverlayManager::createOverlayElement("Orxonox/HUD1.2/MyShip", "Orxonox/HUD1.2/shieldLeftTop", false); 388 // Ogre::OverlayContainer* cont = Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2/MapBackGround"); 389 390 // hud::Bar* newBar = Ogre::OverlayManager::createOverlayElement("Element", "ElementName"); 391 //new hud::Bar(1,true,Ogre::ColourValue::Black,"Orxonox/hi"); 392 // cont->addChild(newBar-> element_); 393 // hud::Bar* newBar = Ogre::OverlayManager::createOverlayElement("orxonox/bar", "orxonox/newbar", false); 394 395 396 Ogre::OverlayManager& overlayManager = Ogre::OverlayManager::getSingleton(); 397 398 Ogre::Overlay* hudOverlay = overlayManager.create("orxonoxsuperoverlay"); 399 400 hud::Bar* newBar = static_cast<hud::Bar*>(overlayManager.createOverlayElement("Panel", "Bar")); 401 newBar->setLeft(0); 402 newBar->setTop(0); 403 newBar->setWidth(10); 404 newBar->setHeight(10); 405 newBar->setMaterialName("Orxonox/Red"); 406 newBar->setMetricsMode(Ogre::GMM_PIXELS); 407 newBar->setPercentage(0.8); 408 newBar->show(); 409 410 411 Ogre::OverlayContainer* panel = static_cast<Ogre::OverlayContainer*> (overlayManager.createOverlayElement("Panel", "PanelName")); 412 panel->setLeft(10); 413 panel->setTop(10); 414 panel->setWidth(100); 415 panel->setHeight(100); 416 panel->setMetricsMode(Ogre::GMM_PIXELS); 417 panel->show(); 418 419 hudOverlay->add2D(panel); 420 panel->addChild(newBar); 421 422 // HUD* orxonoxHud; 423 // orxonoxHud = new HUD(); 424 // orxonoxHud->setEnergyValue(20); 425 // orxonoxHud->setEnergyDistr(20,20,60); 389 426 hudOverlay->show(); 427 390 428 391 429 /*
Note: See TracChangeset
for help on using the changeset viewer.