Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 23, 2008, 6:49:46 PM (16 years ago)
Author:
FelixSchulthess
Message:

moved navigation marker to new class: Navigation

Location:
code/trunk/src/orxonox/hud
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/hud/HUD.cc

    r1393 r1394  
    6060        orxonoxHUD = om->create("Orxonox/HUD");
    6161        container = static_cast<Ogre::OverlayContainer*>(om->createOverlayElement("Panel", "Orxonox/HUD/container"));
    62         // test
    63         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");
    7062
    7163        // creating text to display fps
     
    10193        container->setHeight(1.0);
    10294        container->setMetricsMode(Ogre::GMM_RELATIVE);
    103         container->addChild(test);
    10495        container->addChild(fpsText);
    10596
     
    121112    void HUD::tick(float dt)
    122113    {
    123         int d = (float)(nav->getDist2Focus()/10);
    124         if(d) test->setCaption("Distance: " + Ogre::StringConverter::toString(d));
    125         else test->setCaption("");
    126 
    127114        energyBar->resize();
    128115
  • code/trunk/src/orxonox/hud/HUD.h

    r1393 r1394  
    5151            Ogre::Overlay* orxonoxHUD;
    5252            Ogre::OverlayContainer* container;
    53             Ogre::TextAreaOverlayElement* test;
    5453            Ogre::TextAreaOverlayElement* fpsText;
    5554            BarOverlayElement* energyBar;
  • code/trunk/src/orxonox/hud/Navigation.cc

    r1393 r1394  
    11/*
    2 *   ORXONOX - the hottest 3D action shooter ever to exist
     2*   ORXONOX - the hotnavText_ 3D action shooter ever to exist
    33*
    44*
     
    5050    void Navigation::init(){
    5151                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
    5263        // create nav marker ...
    5364        navMarker_ = static_cast<PanelOverlayElement*>(om->createOverlayElement("Panel", "NavMarker"));
     
    96107            }
    97108        }
     109
     110        int d = (float)(getDist2Focus()/10);
     111        if(d) test->setCaption("Distance: " + Ogre::StringConverter::toString(d));
     112        else test->setCaption("");
    98113    }
    99114
  • code/trunk/src/orxonox/hud/Navigation.h

    r1393 r1394  
    3131#include <OgrePrerequisites.h>
    3232#include <OgrePanelOverlayElement.h>
     33#include <OgreTextAreaOverlayElement.h>
    3334#include "../OrxonoxPrereqs.h"
    3435#include "util/Math.h"
     
    4142        private:
    4243                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...
    4347                Vector3 shipPos_;                           // position of ship
    4448                int windowW_, windowH_;
     
    5054                Navigation(Ogre::OverlayContainer* container, RadarObject* focus);
    5155                ~Navigation();
    52             Ogre::OverlayContainer* container_;
    53                         Ogre::PanelOverlayElement* navMarker_;     // the panel used to show the dot
    5456                        RadarObject* focus_;                        // next pointer of linked list
    5557
Note: See TracChangeset for help on using the changeset viewer.