Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3845 in orxonox.OLD for orxonox/trunk/src/lib/graphics


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

Location:
orxonox/trunk/src/lib/graphics
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/graphics/text_engine.cc

    r3844 r3845  
    138138   \param alignment the alignment to set
    139139*/
    140 void Text::setAlignment(TEXT_ALIGNMENT alignemnt)
     140void Text::setAlignment(TEXT_ALIGNMENT alignment)
    141141{
    142142  this->alignment = alignment;
     
    185185  // setting the Position of this Text.
    186186  Vector pos;
    187   if (this->bindNode)
     187  if (this->alignment == TEXT_ALIGN_SCREEN_CENTER)
     188    {
     189      pos.x = GraphicsEngine::getInstance()->getResolutionX()/2 + this->posSize.x;
     190      pos.y = GraphicsEngine::getInstance()->getResolutionY()/2 + this->posSize.y;
     191      pos.z = 0;
     192    }
     193  else if (this->bindNode)
    188194    {
    189195      GLdouble x = this->bindNode->getAbsCoor().x;
     
    211217  if (this->alignment == TEXT_ALIGN_RIGHT)
    212218    glTranslatef(-this->posSize.w, 0, 0);
    213   else   if (this->alignment == TEXT_ALIGN_CENTER)
     219  else   if (this->alignment == TEXT_ALIGN_CENTER || this->alignment == TEXT_ALIGN_SCREEN_CENTER)
    214220    glTranslatef(-this->posSize.w/2, 0, 0);
    215221
  • orxonox/trunk/src/lib/graphics/text_engine.h

    r3843 r3845  
    3030
    3131//! An enumerator for the text alignment.
    32 enum TEXT_ALIGNMENT {TEXT_ALIGN_LEFT, TEXT_ALIGN_RIGHT, TEXT_ALIGN_CENTER};
     32enum TEXT_ALIGNMENT {TEXT_ALIGN_LEFT, TEXT_ALIGN_RIGHT, TEXT_ALIGN_CENTER, TEXT_ALIGN_SCREEN_CENTER};
    3333
    3434/* some default values */
     
    104104  void setText(const char* text);
    105105  void setPosition(int x, int y);
    106   void setAlignment(TEXT_ALIGNMENT alignemnt);
     106  void setAlignment(TEXT_ALIGNMENT alignment);
    107107  /** \param blending the blending intensity to set (between 0.0 and 1.0) */
    108108  inline void setBlending(float blending) {this->blending = blending;}
Note: See TracChangeset for help on using the changeset viewer.