Changeset 1394
- Timestamp:
- May 23, 2008, 6:49:46 PM (17 years ago)
- Location:
- code/trunk/src/orxonox/hud
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/hud/HUD.cc
r1393 r1394 60 60 orxonoxHUD = om->create("Orxonox/HUD"); 61 61 container = static_cast<Ogre::OverlayContainer*>(om->createOverlayElement("Panel", "Orxonox/HUD/container")); 62 // test63 test = static_cast<TextAreaOverlayElement*>(om->createOverlayElement("TextArea", "test123"));64 test->show();65 test->setMetricsMode(Ogre::GMM_RELATIVE);66 test->setDimensions(0.3, 0.3);67 test->setPosition(0.02, 0.02);68 test->setFontName("Console");69 test->setCaption("init");70 62 71 63 // creating text to display fps … … 101 93 container->setHeight(1.0); 102 94 container->setMetricsMode(Ogre::GMM_RELATIVE); 103 container->addChild(test);104 95 container->addChild(fpsText); 105 96 … … 121 112 void HUD::tick(float dt) 122 113 { 123 int d = (float)(nav->getDist2Focus()/10);124 if(d) test->setCaption("Distance: " + Ogre::StringConverter::toString(d));125 else test->setCaption("");126 127 114 energyBar->resize(); 128 115 -
code/trunk/src/orxonox/hud/HUD.h
r1393 r1394 51 51 Ogre::Overlay* orxonoxHUD; 52 52 Ogre::OverlayContainer* container; 53 Ogre::TextAreaOverlayElement* test;54 53 Ogre::TextAreaOverlayElement* fpsText; 55 54 BarOverlayElement* energyBar; -
code/trunk/src/orxonox/hud/Navigation.cc
r1393 r1394 1 1 /* 2 * ORXONOX - the hot test3D action shooter ever to exist2 * ORXONOX - the hotnavText_ 3D action shooter ever to exist 3 3 * 4 4 * … … 50 50 void Navigation::init(){ 51 51 om = &OverlayManager::getSingleton(); 52 // create nav text 53 navText_ = static_cast<TextAreaOverlayElement*>(om->createOverlayElement("TextArea", "navText")); 54 navText_->show(); 55 navText_->setMetricsMode(Ogre::GMM_RELATIVE); 56 navText_->setDimensions(0.3, 0.3); 57 navText_->setPosition(0.02, 0.02); 58 navText_->setFontName("Console"); 59 navText_->setCaption("init"); 60 container_->addChild(navText_); 61 62 52 63 // create nav marker ... 53 64 navMarker_ = static_cast<PanelOverlayElement*>(om->createOverlayElement("Panel", "NavMarker")); … … 96 107 } 97 108 } 109 110 int d = (float)(getDist2Focus()/10); 111 if(d) test->setCaption("Distance: " + Ogre::StringConverter::toString(d)); 112 else test->setCaption(""); 98 113 } 99 114 -
code/trunk/src/orxonox/hud/Navigation.h
r1393 r1394 31 31 #include <OgrePrerequisites.h> 32 32 #include <OgrePanelOverlayElement.h> 33 #include <OgreTextAreaOverlayElement.h> 33 34 #include "../OrxonoxPrereqs.h" 34 35 #include "util/Math.h" … … 41 42 private: 42 43 Ogre::OverlayManager* om; // our one and only overlay manager 44 Ogre::OverlayContainer* container_; 45 Ogre::PanelOverlayElement* navMarker_; // the panel used to show the arrow 46 Ogre::TextAreaOverlayElement navText_; // displaying distance... 43 47 Vector3 shipPos_; // position of ship 44 48 int windowW_, windowH_; … … 50 54 Navigation(Ogre::OverlayContainer* container, RadarObject* focus); 51 55 ~Navigation(); 52 Ogre::OverlayContainer* container_;53 Ogre::PanelOverlayElement* navMarker_; // the panel used to show the dot54 56 RadarObject* focus_; // next pointer of linked list 55 57
Note: See TracChangeset
for help on using the changeset viewer.