- Timestamp:
- Apr 11, 2005, 2:07:13 PM (20 years ago)
- Location:
- orxonox/branches/textEngine/src/lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/textEngine/src/lib/graphics/font/text_engine.cc
r3772 r3773 41 41 /// TEXT /// 42 42 //////////// 43 /** 44 \brief creates a new Text Element 45 \param font the Font to render this text in 46 \param type The renderType to display this font in 47 48 this constructor is private, because the user should initialize 49 a text with the TextEngine. 50 */ 43 51 Text::Text(Font* font, int type) 44 52 { … … 54 62 } 55 63 56 64 /** 65 \brief deletes a Text out of memory 66 67 This also ereases the text from the textList of the TextEngine 68 */ 57 69 Text::~Text(void) 58 70 { … … 807 819 \see Text::Text 808 820 */ 809 Text* TextEngine::createText(const char* fontFile, unsigned int fontSize, Uint8 r, Uint8 g, Uint8 b)821 Text* TextEngine::createText(const char* fontFile, unsigned int fontSize, int textType, Uint8 r, Uint8 g, Uint8 b) 810 822 { 811 823 Font* tmpFont; 812 824 Text* newText; 825 813 826 814 827 tmpFont = (Font*)ResourceManager::getInstance()->load(fontFile, TTF, RP_GAME); … … 828 841 \brief removes a Text from the List 829 842 \param the text to delete 843 844 this only ereases allocated memory, and removes the text 845 The normal way to call it, is through "delete text;" 846 So you do not have to concetn yourselves with this. 830 847 */ 831 848 void TextEngine::deleteText(Text* text) … … 839 856 \brief draws all the Texts that have been initialized 840 857 */ 841 void TextEngine::draw(void) 858 void TextEngine::draw(void) const 842 859 { 843 860 tIterator<Text>* textIterator = textList->getIterator(); -
orxonox/branches/textEngine/src/lib/graphics/font/text_engine.h
r3772 r3773 92 92 class Text 93 93 { 94 friend class TextEngine; 94 95 public: 95 Text(Font* font, int type = TEXT_DYNAMIC);96 96 ~Text(void); 97 97 … … 113 113 virtual void draw(void); 114 114 115 private: 116 Text(Font* font, int type = TEXT_DYNAMIC); 115 117 116 118 Font* font; … … 186 188 /////////////////// 187 189 //! A singleton Class that operates as a Handler for generating and rendering Text in 2D 188 class TextEngine : public BaseObject {189 190 class TextEngine : public BaseObject 191 { 190 192 public: 191 193 static TextEngine* getInstance(void); … … 194 196 Text* createText(const char* fontFile, 195 197 unsigned int fontSize = FONT_DEFAULT_SIZE, 198 int textType = TEXT_DYNAMIC, 196 199 Uint8 r = FONT_DEFAULT_COLOR_R, 197 200 Uint8 g = FONT_DEFAULT_COLOR_G, … … 200 203 void deleteText(Text* text); 201 204 202 void draw(void) ;203 205 void draw(void) const; 206 204 207 private: 205 208 TextEngine(void); -
orxonox/branches/textEngine/src/lib/util/resource_manager.cc
r3769 r3773 309 309 delete (Texture*)resource->pointer; 310 310 break; 311 case TTF: 312 delete (Font*)resource->pointer; 313 break; 311 314 default: 312 315 PRINTF(1)("NOT YET IMPLEMENTED !!FIX FIX!!\n");
Note: See TracChangeset
for help on using the changeset viewer.