Changeset 7919 in orxonox.OLD for trunk/src/lib/graphics/text_engine
- Timestamp:
- May 28, 2006, 3:48:13 PM (19 years ago)
- Location:
- trunk/src/lib/graphics/text_engine
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/text_engine/multi_line_text.cc
r7758 r7919 64 64 return; 65 65 glPushMatrix(); 66 glPushAttrib(GL_ENABLE_BIT); 66 67 // transform for alignment. 67 68 // TODO make the Stuff with the alignment … … 117 118 } 118 119 glEnd(); 120 glPopAttrib(); 119 121 glPopMatrix(); 120 122 } -
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 -
trunk/src/lib/graphics/text_engine/text.h
r7753 r7919 37 37 void setText(const std::string& text); 38 38 void append(const std::string& appendText); 39 void appendCharacter(char character); 39 40 const std::string& operator<<(const std::string& appendText); 41 void removeCharacters(unsigned int chars); 40 42 41 43 /// SETUP
Note: See TracChangeset
for help on using the changeset viewer.