Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 22, 2008, 3:57:27 PM (16 years ago)
Author:
FelixSchulthess
Message:

added fps counter

File:
1 edited

Legend:

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

    r1362 r1374  
    6060        test->show();
    6161        test->setMetricsMode(Ogre::GMM_RELATIVE);
    62         test->setDimensions(0.8, 0.8);
     62        test->setDimensions(0.3, 0.3);
    6363        test->setPosition(0.02, 0.02);
    6464        test->setFontName("Console");
    6565        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");
    6675
    6776        // create energy bar
     
    8695        container->setMetricsMode(Ogre::GMM_RELATIVE);
    8796        container->addChild(test);
     97        container->addChild(fpsText);
    8898        energyBar->init(0.01, 0.94, 0.4, container);
    8999        energyBar->setValue(1);
     
    113123    }
    114124
     125    void HUD::setFPS(float fps){
     126        fpsText->setCaption("FPS: " + Ogre::StringConverter::toString(fps));
     127    }
     128
    115129    HUD::~HUD(void){
    116130    }
Note: See TracChangeset for help on using the changeset viewer.