Changeset 1374 for code/trunk/src/orxonox
- Timestamp:
- May 22, 2008, 3:57:27 PM (17 years ago)
- Location:
- code/trunk/src/orxonox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/Orxonox.cc
r1362 r1374 487 487 // orxonoxHUD_->setRocket2(ogreRoot.getCurrentFrameNumber()); 488 488 if (eventTimes[3].back() - eventTimes[3].front() != 0) 489 // orxonoxHUD_->setRocket1((int)(50000.0f/(eventTimes[3].back() - eventTimes[3].front())));489 orxonoxHUD_->setFPS(50000.0f/(eventTimes[3].back() - eventTimes[3].front())); 490 490 491 491 // Iterate through all Tickables and call their tick(dt) function -
code/trunk/src/orxonox/hud/HUD.cc
r1362 r1374 60 60 test->show(); 61 61 test->setMetricsMode(Ogre::GMM_RELATIVE); 62 test->setDimensions(0. 8, 0.8);62 test->setDimensions(0.3, 0.3); 63 63 test->setPosition(0.02, 0.02); 64 64 test->setFontName("Console"); 65 65 test->setCaption("init"); 66 67 // test2 68 fpsText = static_cast<TextAreaOverlayElement*>(om->createOverlayElement("TextArea", "fpsText")); 69 fpsText->show(); 70 fpsText->setMetricsMode(Ogre::GMM_RELATIVE); 71 fpsText->setDimensions(0.3, 0.3); 72 fpsText->setPosition(0.9, 0.02); 73 fpsText->setFontName("Console"); 74 fpsText->setCaption("init"); 66 75 67 76 // create energy bar … … 86 95 container->setMetricsMode(Ogre::GMM_RELATIVE); 87 96 container->addChild(test); 97 container->addChild(fpsText); 88 98 energyBar->init(0.01, 0.94, 0.4, container); 89 99 energyBar->setValue(1); … … 113 123 } 114 124 125 void HUD::setFPS(float fps){ 126 fpsText->setCaption("FPS: " + Ogre::StringConverter::toString(fps)); 127 } 128 115 129 HUD::~HUD(void){ 116 130 } -
code/trunk/src/orxonox/hud/HUD.h
r1362 r1374 50 50 Ogre::OverlayContainer* container; 51 51 Ogre::TextAreaOverlayElement* test; 52 Ogre::TextAreaOverlayElement* fpsText; 52 53 BarOverlayElement* energyBar; 53 54 BarOverlayElement* speedoBar; … … 57 58 HUD(int zoom); 58 59 ~HUD(); 60 void setFPS(float fps); 59 61 virtual void tick(float); 60 62
Note: See TracChangeset
for help on using the changeset viewer.