Changeset 5306 in orxonox.OLD for trunk/src/lib/graphics/text_engine.cc
- Timestamp:
- Oct 7, 2005, 6:17:49 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/text_engine.cc
r5290 r5306 42 42 /// TEXT /// 43 43 //////////// 44 45 /** 46 * creates a new Text Element 47 * @param fontFile the Font to render this text in 48 * @param type The renderType to display this font in 49 */ 50 Text::Text(const char* fontFile, unsigned int fontSize, TEXT_RENDER_TYPE type) 51 { 52 this->init(); 53 54 if (fontFile != NULL) 55 this->setFont(fontFile, fontSize); 56 this->setType(type); 57 } 58 44 59 /** 45 60 * creates a new Text Element 46 61 * @param font the Font to render this text in 47 62 * @param type The renderType to display this font in 48 49 50 51 */63 * 64 * this constructor is private, because the user should initialize 65 * a text with the TextEngine. 66 */ 52 67 Text::Text(Font* font, TEXT_RENDER_TYPE type) 53 68 { 69 this->init(); 70 71 this->font = font; 72 this->setType(type); 73 } 74 75 /** 76 * deletes a Text out of memory 77 * 78 * This also ereases the text from the textList of the TextEngine 79 */ 80 Text::~Text() 81 { 82 if (this->font != NULL) 83 ResourceManager::getInstance()->unload(this->font); 84 85 if (this->text) 86 delete[] this->text; 87 } 88 89 void Text::init() 90 { 54 91 this->setClassID(CL_TEXT, "Text"); 55 92 56 93 // initialize this Text 57 this->font = font;94 this->font = NULL; 58 95 this->text = NULL; 59 96 this->externText = NULL; … … 62 99 this->blending = TEXT_DEFAULT_BLENDING; 63 100 this->color = TEXT_DEFAULT_COLOR; 64 this->setType( type);101 this->setType(TEXT_RENDER_DYNAMIC); 65 102 66 103 this->setText(NULL); 67 }68 69 /**70 * deletes a Text out of memory71 *72 * This also ereases the text from the textList of the TextEngine73 */74 Text::~Text()75 {76 if (this->font != NULL)77 ResourceManager::getInstance()->unload(this->font);78 79 if (this->text)80 delete[] this->text;81 104 } 82 105
Note: See TracChangeset
for help on using the changeset viewer.