Changeset 5089 in orxonox.OLD for trunk/src/lib/graphics/text_engine.cc
- Timestamp:
- Aug 21, 2005, 8:17:31 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/text_engine.cc
r5078 r5089 55 55 56 56 // initialize this Text 57 this->bindNode = NULL;58 57 this->font = font; 59 58 this->text = NULL; 60 this-> alignment = TEXT_DEFAULT_ALIGNMENT;59 this->setAlignment(TEXT_DEFAULT_ALIGNMENT); 61 60 this->texture = 0; 62 61 this->blending = 1.0f; … … 112 111 113 112 // 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) 115 114 { 116 115 Glyph** glyphArray = this->font->getGlyphArray(); … … 173 172 glPushMatrix(); 174 173 // transform for alignment. 175 if (this-> alignment== TEXT_ALIGN_RIGHT)174 if (this->getAlignment() == TEXT_ALIGN_RIGHT) 176 175 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) 178 177 glTranslatef(-this->posSize.w/2, 0, 0); 179 178 … … 191 190 192 191 glTexCoord2f(this->texCoord.minU, this->texCoord.minV); 193 glVertex2f(this-> absPos2D.x, this->absPos2D.y );192 glVertex2f(this->getAbsCoor2D().x, this->getAbsCoor2D().y ); 194 193 195 194 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 ); 197 196 198 197 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); 200 199 201 200 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); 203 202 204 203 glEnd(); … … 209 208 glBindTexture(GL_TEXTURE_2D, this->font->getFastTextureID()); 210 209 // glEnable(GL_TEXTURE_2D); 211 glTranslatef( absPos2D.x, absPos2D.y, 0);210 glTranslatef(getAbsCoor2D().x, getAbsCoor2D().y, 0); 212 211 213 212 const char* tmpText = this->text; … … 231 230 { 232 231 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()); 235 234 PRINT(0)("Relative Position: (%d::%d)\n", this->posSize.x, this->posSize.y); 236 235 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.