Changeset 5380 in orxonox.OLD for branches/2d-recalc/src/lib/graphics/text_engine
- Timestamp:
- Oct 15, 2005, 1:49:17 AM (19 years ago)
- Location:
- branches/2d-recalc/src/lib/graphics/text_engine
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2d-recalc/src/lib/graphics/text_engine/text.cc
r5376 r5380 29 29 /** 30 30 * creates a new Text Element 31 * @param textSize the size of the font to be displayed. 31 32 * @param fontFile the Font to render this text in 32 33 * @param type The renderType to display this font in … … 39 40 this->setFont(fontFile, FONT_DEFAULT_RENDER_SIZE); 40 41 this->setType(type); 41 this->s ize = textSize;42 this->setSizeY2Dpx(textSize); 42 43 } 43 44 … … 71 72 this->blending = TEXT_DEFAULT_BLENDING; 72 73 this->color = TEXT_DEFAULT_COLOR; 73 this->s ize = TEXT_DEFAULT_SIZE;74 this->setSizeY2Dpx(TEXT_DEFAULT_SIZE); 74 75 this->setType(TEXT_RENDER_DYNAMIC); 75 76 … … 250 251 glBegin(GL_QUADS); 251 252 glTexCoord2f(tmpGlyph->texCoord[0], tmpGlyph->texCoord[2]); 252 glVertex2d(posX, - tmpGlyph->bearingY * this-> size);253 glVertex2d(posX, - tmpGlyph->bearingY * this->getSizeY2D()); 253 254 glTexCoord2f(tmpGlyph->texCoord[0], tmpGlyph->texCoord[3]); 254 glVertex2d(posX, (tmpGlyph->height - tmpGlyph->bearingY)*this-> size);255 glVertex2d(posX, (tmpGlyph->height - tmpGlyph->bearingY)*this->getSizeY2D()); 255 256 glTexCoord2f(tmpGlyph->texCoord[1], tmpGlyph->texCoord[3]); 256 glVertex2d(posX+tmpGlyph->width*this-> size, (tmpGlyph->height - tmpGlyph->bearingY)*this->size);257 glVertex2d(posX+tmpGlyph->width*this->getSizeY2D(), (tmpGlyph->height - tmpGlyph->bearingY)*this->getSizeY2D()); 257 258 glTexCoord2f(tmpGlyph->texCoord[1], tmpGlyph->texCoord[2]); 258 glVertex2d(posX+tmpGlyph->width*this-> size, - tmpGlyph->bearingY*this->size);259 glVertex2d(posX+tmpGlyph->width*this->getSizeY2D(), - tmpGlyph->bearingY*this->getSizeY2D()); 259 260 glEnd(); 260 261 glEndList(); 261 posX += tmpGlyph->width*this-> size;262 posX += tmpGlyph->width*this->getSizeY2D(); 262 263 } 263 264 tmpText++; … … 298 299 PRINT(0)("=== TEXT: %s ===\n", this->externText); 299 300 300 if (this->getBindNode())301 PRINT(0)("is bind to %s; ref=%p\n", this->getBindNode()->getName(), this->getBindNode());302 301 PRINT(0)("Color: %0.2f %0.2f %0.2f\n", this->color.x, this->color.y, this->color.z); 303 302 } -
branches/2d-recalc/src/lib/graphics/text_engine/text.h
r5378 r5380 55 55 public: 56 56 Text(const char* fontFile, unsigned int fontSize = TEXT_DEFAULT_SIZE, TEXT_RENDER_TYPE type = TEXT_RENDER_DYNAMIC); 57 Text(const char* fontFile, float fontSize); 57 58 ~Text(); 58 59 void init(); … … 69 70 void setColor(float r, float g, float b) { this->color = Vector(r, g, b); }; 70 71 /** sets the Size of the Font */ 71 void setSize(float size) { this->size = size; }; 72 /** @returns the Size of the Text */ 73 // void getSize(float &x, float& y) const { return this->size; }; 72 inline void setTextSize(unsigned int size) { this->setSizeY2Dpx(size); }; 74 73 75 74 void setType(TEXT_RENDER_TYPE type); … … 92 91 Vector color; //!< The color of the font. 93 92 float blending; //!< The blending intensity. 94 float size; //!< The size of the Font.95 93 96 94 // placement in openGL
Note: See TracChangeset
for help on using the changeset viewer.