Changeset 5120 in orxonox.OLD for trunk/src/util
- Timestamp:
- Aug 25, 2005, 12:08:04 AM (19 years ago)
- Location:
- trunk/src/util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/util/shell.cc
r5119 r5120 185 185 this->bufferText[i] = TextEngine::getInstance()->createText("fonts/Aniron_Bold.ttf", this->textSize, TEXT_DYNAMIC, 255, 0, 0); 186 186 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)); 188 188 this->bufferText[i]->setText(NULL); 189 189 this->bufferText[i]->setParent2D(this); … … 282 282 { 283 283 Text* lastText = this->bufferText[this->bufferDisplaySize-1]; 284 Vector firstCoord = this->bufferText[0]->getRelCoorSoft2D();285 284 286 285 Text* swapText; 287 286 Text* moveText = this->bufferText[0]; 288 this->bufferText[0]->setRelCoorSoft2D(this-> bufferText[1]->getRelCoorSoft2D(), 5);287 this->bufferText[0]->setRelCoorSoft2D(this->calculateLinePosition(1),10); 289 288 for (unsigned int i = 1; i < this->bufferDisplaySize; i++) 290 289 { 291 290 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); 293 292 swapText = this->bufferText[i]; 294 293 this ->bufferText[i] = moveText; 295 294 moveText = swapText; 296 295 } 297 lastText->setRelCoor2D( firstCoord);296 lastText->setRelCoor2D(this->calculateLinePosition(0)); 298 297 this->bufferText[0] = lastText; 299 298 … … 739 738 } 740 739 740 741 /////////////////////// 742 // HELPER FUNCTIONS // 743 /////////////////////// 744 Vector Shell::calculateLinePosition(unsigned int lineNumber) 745 { 746 return Vector(5, (this->textSize + this->lineSpacing)*(this->bufferDisplaySize - lineNumber -1), 0); 747 } 748 749 750 741 751 /** 742 752 * displays some nice output from the Shell -
trunk/src/util/shell.h
r5119 r5120 83 83 const tList<const char>* Shell::createCompleteList(const tList<BaseObject>* inputList, const char* classNameBegin); 84 84 85 // helpers // 86 Vector calculateLinePosition(unsigned int lineNumber); 87 85 88 86 89 private:
Note: See TracChangeset
for help on using the changeset viewer.