Changeset 5123 in orxonox.OLD for trunk/src/lib
- Timestamp:
- Aug 25, 2005, 2:13:22 AM (19 years ago)
- Location:
- trunk/src/lib/graphics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/text_engine.cc
r5122 r5123 143 143 tmpText++; 144 144 } 145 this-> posSize.w= width;145 this->width = width; 146 146 } 147 147 } … … 168 168 this->texture = loadTexture(tmpSurf, &this->texCoord); 169 169 170 this-> posSize.w= tmpSurf->w;171 this-> posSize.h= tmpSurf->h;170 this->width = tmpSurf->w; 171 this->height = tmpSurf->h; 172 172 SDL_FreeSurface(tmpSurf); 173 173 } … … 181 181 // transform for alignment. 182 182 if (this->getAlignment() == TEXT_ALIGN_RIGHT) 183 glTranslatef(-this-> posSize.w, 0, 0);183 glTranslatef(-this->width, 0, 0); 184 184 else if (this->getAlignment() == TEXT_ALIGN_CENTER || this->getAlignment() == TEXT_ALIGN_SCREEN_CENTER) 185 glTranslatef(-this-> posSize.w/2, 0, 0);185 glTranslatef(-this->width/2, 0, 0); 186 186 187 187 // drawing this Text. … … 223 223 224 224 glTexCoord2f(this->texCoord.maxU, this->texCoord.minV); 225 glVertex2f(this->getAbsCoor2D().x + this-> posSize.w, this->getAbsCoor2D().y );225 glVertex2f(this->getAbsCoor2D().x + this->width, this->getAbsCoor2D().y ); 226 226 227 227 glTexCoord2f(this->texCoord.maxU, this->texCoord.maxV); 228 glVertex2f(this->getAbsCoor2D().x + this-> posSize.w, getAbsCoor2D().y + this->posSize.h);228 glVertex2f(this->getAbsCoor2D().x + this->width, getAbsCoor2D().y + this->height); 229 229 230 230 glTexCoord2f(this->texCoord.minU, this->texCoord.maxV); 231 glVertex2f(getAbsCoor2D().x, getAbsCoor2D().y + this-> posSize.h);231 glVertex2f(getAbsCoor2D().x, getAbsCoor2D().y + this->height); 232 232 233 233 glEnd(); … … 249 249 if (this->getBindNode()) 250 250 PRINT(0)("is bind to %s; ref=%p\n", this->getBindNode()->getName(), this->getBindNode()); 251 PRINT(0)("Relative Position: (%d::%d)\n", this->posSize.x, this->posSize.y);252 251 PRINT(0)("Color: %0.2f %0.2f %0.2f\n", this->color.x, this->color.y, this->color.z); 253 252 } -
trunk/src/lib/graphics/text_engine.h
r5122 r5123 139 139 GLuint texture; //!< A GL-texture to hold the text 140 140 TexCoord texCoord; //!< Texture-coordinates @todo fix this to have a struct 141 SDL_Rect posSize; //!< An SDL-Rectangle representing the position and size of the Text on the screen. 141 float height; 142 float width; 142 143 }; 143 144
Note: See TracChangeset
for help on using the changeset viewer.