Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5380 in orxonox.OLD for branches/2d-recalc/src/lib/shell/shell.cc


Ignore:
Timestamp:
Oct 15, 2005, 1:49:17 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: some 2d-adaptions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2d-recalc/src/lib/shell/shell.cc

    r5377 r5380  
    8181  this->backgroundMaterial = new Material;
    8282  // Element2D and generals
    83   this->setAbsCoor2D(3, -400);
    84   this->textSize = 20;
    85   this->lineSpacing = 0;
     83  this->textSize = .001;
     84  this->lineSpacing = .001;
    8685  this->bActive = false;
    8786  this->fontFile = new char[strlen(SHELL_DEFAULT_FONT)+1];
     
    9392  this->setTextColor(SHELL_DEFAULT_TEXT_COLOR);
    9493  this->setBackgroundColor(SHELL_DEFAULT_BACKGROUND_COLOR);
    95 
     94  this->setRelCoor2D(0,-this->shellHeight, 0);
    9695  // register the shell at the ShellBuffer
    9796  ShellBuffer::getInstance()->registerShell(this);
     
    128127
    129128  EventHandler::getInstance()->setState(ES_SHELL);
    130   this->setRelCoorSoft2D(0, 0, 1, 5);
     129  this->setRelCoorSoft2D(0, 0, 0, 5);
    131130
    132131  tIterator<char>* bufferIT = ShellBuffer::getInstance()->getBuffer()->getIterator();
     
    250249  if (this->shellInput != NULL)
    251250  {
    252     this->shellInput->setSize(this->textSize);
     251    this->shellInput->setSizeY2D(this->textSize);
    253252    this->shellInput->setColor(this->textColor[0], this->textColor[1], this->textColor[2]);
    254253    this->shellInput->setBlending(this->textColor[3]);
    255     this->shellInput->setRelCoor2D(5, (this->textSize + this->lineSpacing)*this->bufferDisplaySize + this->textSize);
     254    this->shellInput->setRelCoor2D(.005, (this->textSize + this->lineSpacing)*this->bufferDisplaySize + this->textSize);
    256255  }
    257256
     
    262261      if (this->bufferText[i] != NULL)
    263262      {
    264         this->bufferText[i]->setSize(this->textSize);
     263        this->bufferText[i]->setSizeY2D(this->textSize);
    265264        this->bufferText[i]->setColor(this->textColor[0], this->textColor[1], this->textColor[2]);
    266265        this->bufferText[i]->setBlending(this->textColor[3]);
     
    269268    }
    270269  }
    271   this->shellHeight = (this->textSize + this->lineSpacing) * (bufferDisplaySize+1);
    272 
     270  this->shellHeight = (float)(this->textSize + this->lineSpacing) * (bufferDisplaySize+1.0);
    273271}
    274272
     
    365363  */
    366364    lastText->setRelDir2D(-90);
    367     lastText->setRelDirSoft2D(0, 10);
    368     lastText->setRelCoor2D(this->calculateLinePosition(0)- Vector(-1000,0,0));
     365    lastText->setRelDirSoft2D(0, 1);
     366    lastText->setRelCoor2D(this->calculateLinePosition(0)- Vector(-1,0,0));
    369367    lastText->setRelCoorSoft2D(this->calculateLinePosition(0),10);
    370368
     
    478476
    479477  glTexCoord2f(1, 0);
    480   glVertex2f(GraphicsEngine::getInstance()->getResolutionX() - this->getAbsCoor2D().x, this->getAbsCoor2D().y  );
     478  glVertex2f(1 - this->getAbsCoor2D().x, this->getAbsCoor2D().y  );
    481479
    482480  glTexCoord2f(0, 1);
     
    484482
    485483  glTexCoord2f(1, 1);
    486   glVertex2f(GraphicsEngine::getInstance()->getResolutionX() - this->getAbsCoor2D().x, this->getAbsCoor2D().y + this->shellHeight);
     484  glVertex2f(1 - this->getAbsCoor2D().x, this->getAbsCoor2D().y + this->shellHeight);
    487485
    488486  glEnd();
Note: See TracChangeset for help on using the changeset viewer.