Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5089 in orxonox.OLD for trunk/src/lib/graphics/text_engine.cc


Ignore:
Timestamp:
Aug 21, 2005, 8:17:31 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: rebuild Element2D. Now it is more like PNode

File:
1 edited

Legend:

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

    r5078 r5089  
    5555
    5656  // initialize this Text
    57   this->bindNode = NULL;
    5857  this->font = font;
    5958  this->text = NULL;
    60   this->alignment = TEXT_DEFAULT_ALIGNMENT;
     59  this->setAlignment(TEXT_DEFAULT_ALIGNMENT);
    6160  this->texture = 0;
    6261  this->blending = 1.0f;
     
    112111
    113112  // setting up the Text-Width if DYNAMIC
    114   if (this->type == TEXT_DYNAMIC && this->alignment != TEXT_ALIGN_LEFT)
     113  if (this->type == TEXT_DYNAMIC && this->getAlignment() != TEXT_ALIGN_LEFT)
    115114    {
    116115      Glyph** glyphArray = this->font->getGlyphArray();
     
    173172  glPushMatrix();
    174173  // transform for alignment.
    175   if (this->alignment == TEXT_ALIGN_RIGHT)
     174  if (this->getAlignment() == TEXT_ALIGN_RIGHT)
    176175    glTranslatef(-this->posSize.w, 0, 0);
    177   else if (this->alignment == TEXT_ALIGN_CENTER || this->alignment == TEXT_ALIGN_SCREEN_CENTER)
     176  else if (this->getAlignment() == TEXT_ALIGN_CENTER || this->getAlignment() == TEXT_ALIGN_SCREEN_CENTER)
    178177    glTranslatef(-this->posSize.w/2, 0, 0);
    179178
     
    191190
    192191      glTexCoord2f(this->texCoord.minU, this->texCoord.minV);
    193       glVertex2f(this->absPos2D.x,   this->absPos2D.y  );
     192      glVertex2f(this->getAbsCoor2D().x,   this->getAbsCoor2D().y  );
    194193
    195194      glTexCoord2f(this->texCoord.maxU, this->texCoord.minV);
    196       glVertex2f(this->absPos2D.x + this->posSize.w, this->absPos2D.y  );
     195      glVertex2f(this->getAbsCoor2D().x + this->posSize.w, this->getAbsCoor2D().y  );
    197196
    198197      glTexCoord2f(this->texCoord.maxU, this->texCoord.maxV);
    199       glVertex2f(this->absPos2D.x + this->posSize.w, absPos2D.y + this->posSize.h);
     198      glVertex2f(this->getAbsCoor2D().x + this->posSize.w, getAbsCoor2D().y + this->posSize.h);
    200199
    201200      glTexCoord2f(this->texCoord.minU, this->texCoord.maxV);
    202       glVertex2f(absPos2D.x, absPos2D.y + this->posSize.h);
     201      glVertex2f(getAbsCoor2D().x, getAbsCoor2D().y + this->posSize.h);
    203202
    204203      glEnd();
     
    209208      glBindTexture(GL_TEXTURE_2D, this->font->getFastTextureID());
    210209      //      glEnable(GL_TEXTURE_2D);
    211       glTranslatef(absPos2D.x, absPos2D.y, 0);
     210      glTranslatef(getAbsCoor2D().x, getAbsCoor2D().y, 0);
    212211
    213212      const char* tmpText = this->text;
     
    231230{
    232231  PRINT(0)("=== TEXT: %s ===\n", this->text);
    233   if (this->bindNode)
    234     PRINT(0)("is bind to %s; ref=%p\n", this->bindNode->getName(), this->bindNode);
     232  if (this->getBindNode())
     233    PRINT(0)("is bind to %s; ref=%p\n", this->getBindNode()->getName(), this->getBindNode());
    235234  PRINT(0)("Relative Position: (%d::%d)\n", this->posSize.x, this->posSize.y);
    236235  PRINT(0)("Color: %d %d %d\n", this->color.r, this->color.g, this->color.b);
Note: See TracChangeset for help on using the changeset viewer.