Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


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

orxonox/trunk: some 2d-adaptions

Location:
branches/2d-recalc/src/lib/shell
Files:
2 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();
  • branches/2d-recalc/src/lib/shell/shell.h

    r5374 r5380  
    9292    // GENERAL
    9393    bool                     bActive;                //!< If the shell is active.
    94     unsigned int             shellHeight;            //!< The hight of the Shell in Pixels.
    95     unsigned int             lineSpacing;            //!< The Spacing between lines.
    96     unsigned int             textSize;               //!< The size of the text.
     94    float                    shellHeight;            //!< The hight of the Shell in Pixels.
     95    float                    lineSpacing;            //!< The Spacing between lines.
     96    float                    textSize;               //!< The size of the text.
    9797    float                    textColor[4];           //!< The text's color [r,g,b,a].
    9898    char*                    fontFile;               //!< The file containing the font.
Note: See TracChangeset for help on using the changeset viewer.