Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5120 in orxonox.OLD for trunk/src/util/shell.cc


Ignore:
Timestamp:
Aug 25, 2005, 12:08:04 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: better calculation of the Line-Positions in the Shell

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/util/shell.cc

    r5119 r5120  
    185185    this->bufferText[i] = TextEngine::getInstance()->createText("fonts/Aniron_Bold.ttf", this->textSize, TEXT_DYNAMIC, 255, 0, 0);
    186186    this->bufferText[i]->setAlignment(TEXT_ALIGN_LEFT);
    187     this->bufferText[i]->setRelCoor2D(5, (this->textSize + this->lineSpacing)*(bufferDisplaySize - i -1));
     187    this->bufferText[i]->setRelCoor2D(calculateLinePosition(i));
    188188    this->bufferText[i]->setText(NULL);
    189189    this->bufferText[i]->setParent2D(this);
     
    282282  {
    283283    Text* lastText = this->bufferText[this->bufferDisplaySize-1];
    284     Vector firstCoord = this->bufferText[0]->getRelCoorSoft2D();
    285284
    286285    Text* swapText;
    287286    Text* moveText = this->bufferText[0];
    288     this->bufferText[0]->setRelCoorSoft2D(this->bufferText[1]->getRelCoorSoft2D(), 5);
     287    this->bufferText[0]->setRelCoorSoft2D(this->calculateLinePosition(1),10);
    289288    for (unsigned int i = 1; i < this->bufferDisplaySize; i++)
    290289    {
    291290      if ( i < this->bufferDisplaySize-1)
    292         this->bufferText[i]->setRelCoorSoft2D(this->bufferText[i+1]->getRelCoorSoft2D(),5);
     291        this->bufferText[i]->setRelCoorSoft2D(this->calculateLinePosition(i+1),5);
    293292      swapText = this->bufferText[i];
    294293      this  ->bufferText[i] = moveText;
    295294      moveText = swapText;
    296295    }
    297     lastText->setRelCoor2D(firstCoord);
     296    lastText->setRelCoor2D(this->calculateLinePosition(0));
    298297    this->bufferText[0] = lastText;
    299298
     
    739738}
    740739
     740
     741///////////////////////
     742// HELPER FUNCTIONS  //
     743///////////////////////
     744Vector Shell::calculateLinePosition(unsigned int lineNumber)
     745{
     746  return Vector(5, (this->textSize + this->lineSpacing)*(this->bufferDisplaySize - lineNumber -1), 0);
     747}
     748
     749
     750
    741751/**
    742752 * displays some nice output from the Shell
Note: See TracChangeset for help on using the changeset viewer.