Changeset 7919 in orxonox.OLD for trunk/src/lib/graphics/text_engine/text.cc
- Timestamp:
- May 28, 2006, 3:48:13 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/text_engine/text.cc
r7753 r7919 36 36 this->font = NULL; 37 37 this->size = textSize; 38 this->setSizeY2D(size); 38 39 this->blending = TEXT_DEFAULT_BLENDING; 39 40 this->color = TEXT_DEFAULT_COLOR; … … 127 128 128 129 /** 130 * @brief appends one Character to the String. 131 */ 132 void Text::appendCharacter(char character) 133 { 134 this->text += character; 135 this->setupTextWidth(); 136 } 137 138 139 /** 129 140 * @brief append some text to the already existing Text. 130 141 * @param appendText The text to append to this Text. … … 135 146 return this->text; 136 147 } 148 149 /** 150 * @brief removes char characters from the Text. 151 * 152 * @note this function checks, if the count can be removed, and if so does it. 153 * Otherwise the maximum count of characters will be removed. 154 */ 155 void Text::removeCharacters(unsigned int chars) 156 { 157 if (text.size() > chars) 158 this->text.resize(this->text.size()-chars); 159 else if (!text.empty()) 160 text.clear(); 161 this->setupTextWidth(); 162 } 163 137 164 138 165 /** … … 188 215 return; 189 216 glPushMatrix(); 217 glPushAttrib(GL_ENABLE_BIT); 190 218 // transform for alignment. 191 219 if (this->getAlignment() == TEXT_ALIGN_RIGHT) … … 229 257 } 230 258 glEnd(); 259 glPopAttrib(); 231 260 glPopMatrix(); 232 261 } … … 242 271 if(this->font->getGlyphArray()[this->text[i]] != NULL) 243 272 width += this->font->getGlyphArray()[this->text[i]]->advance; 244 this->setSizeX2D(width * this->getSize());273 this->setSizeX2D(width * this->getSize()); 245 274 } 246 275
Note: See TracChangeset
for help on using the changeset viewer.