Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3845 in orxonox.OLD for orxonox/trunk/src/track_manager.cc


Ignore:
Timestamp:
Apr 17, 2005, 1:19:54 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: now some text gets displayed, when changing the Track

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/track_manager.cc

    r3842 r3845  
    2323#include "stdincl.h"
    2424#include "list.h"
    25 
    26 
     25#include "text_engine.h"
     26#include "animation.h"
    2727
    2828#include <stdarg.h>
     
    386386  this->maxTime = 0;
    387387  this->trackElemCount = 1;
     388
    388389  this->trackNode = new TrackNode();
    389390  this->setBindSlave(this->trackNode);
     391  // initializing the Text
     392  this->trackText = TextEngine::getInstance()->createText("fonts/earth.ttf", 30, TEXT_DYNAMIC, 0, 255, 0);
     393  this->trackText->setAlignment(TEXT_ALIGN_SCREEN_CENTER);
     394  // initializing the Animation for the Text.
     395  this->textAnimation = new tAnim<Text>(this->trackText, &Text::setBlending);
     396  this->textAnimation->addKeyFrame(1.0, 1.0, ANIM_LINEAR);
     397  this->textAnimation->addKeyFrame(0.0, 1.0);
     398  this->textAnimation->setInfinity(ANIM_INF_CONSTANT);
    390399}
    391400
     
    929938      this->currentTrackElem = this->currentTrackElem->getChild(this->choosePath(this->currentTrackElem));
    930939      this->currentTrackElem->history = tmpHistoryElem;
     940      if (this->currentTrackElem->getName())
     941        {
     942          this->trackText->setText(this->currentTrackElem->getName());
     943          this->textAnimation->play();
     944        }
    931945    }
    932946  if (this->bindSlave)
     
    954968{
    955969  if (time == 0)
    956     this->currentTrackElem = this->firstTrackElem;
     970    {
     971      this->currentTrackElem = this->firstTrackElem;
     972      if (this->currentTrackElem->getName())
     973        {
     974          this->trackText->setText(this->currentTrackElem->getName());
     975          this->textAnimation->play();
     976        }
     977    }
    957978  this->localTime = time;
    958979}
Note: See TracChangeset for help on using the changeset viewer.