Changeset 4836 in orxonox.OLD for orxonox/trunk/src/lib/graphics/text_engine.cc
- Timestamp:
- Jul 12, 2005, 12:33:16 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/text_engine.cc
r4834 r4836 42 42 //////////// 43 43 /** 44 \briefcreates a new Text Element45 \param font the Font to render this text in46 \param type The renderType to display this font in44 * 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 47 48 48 this constructor is private, because the user should initialize … … 67 67 68 68 /** 69 \briefdeletes a Text out of memory69 * deletes a Text out of memory 70 70 71 71 This also ereases the text from the textList of the TextEngine … … 77 77 78 78 /** 79 \brieftells the Text, that it should folow a PNode80 \param bindNode: the node to bind this text to79 * tells the Text, that it should folow a PNode 80 * @param bindNode: the node to bind this text to 81 81 */ 82 82 void Text::setBindNode(PNode* bindNode) … … 86 86 87 87 /** 88 \briefsets the Type of this Text89 \param type the type to set.88 * sets the Type of this Text 89 * @param type the type to set. 90 90 */ 91 91 void Text::setType(int type) … … 98 98 99 99 /** 100 \briefSets a new Text to the font101 \param text the new text to set100 * Sets a new Text to the font 101 * @param text the new text to set 102 102 */ 103 103 void Text::setText(const char* text) … … 129 129 130 130 /** 131 \briefsets a Position.132 \param x the x-position in pixels from the left border133 \param y the y-position in pixels from the top border131 * sets a Position. 132 * @param x the x-position in pixels from the left border 133 * @param y the y-position in pixels from the top border 134 134 */ 135 135 void Text::setPosition(int x, int y) … … 140 140 141 141 /** 142 \briefsets the text-alignment143 \param alignment the alignment to set142 * sets the text-alignment 143 * @param alignment the alignment to set 144 144 */ 145 145 void Text::setAlignment(TEXT_ALIGNMENT alignment) … … 149 149 150 150 /** 151 \briefsets a new color to the font152 \param r Red153 \param g Green154 \param b Blue151 * sets a new color to the font 152 * @param r Red 153 * @param g Green 154 * @param b Blue 155 155 */ 156 156 void Text::setColor(Uint8 r, Uint8 g, Uint8 b) … … 162 162 163 163 /** 164 \briefcreates a texture out of the given parameters164 * creates a texture out of the given parameters 165 165 166 166 this has to be called every time by the user, to if changes were made. … … 185 185 186 186 /** 187 \briefdraws the Font187 * draws the Font 188 188 */ 189 189 void Text::draw() const … … 269 269 270 270 /** 271 \briefprints out some nice debug information about this text271 * prints out some nice debug information about this text 272 272 */ 273 273 void Text::debug() const … … 285 285 //////////// 286 286 /** 287 \briefLoads a Font from an SDL_surface into a texture.288 \param surface The surface to make the texture of289 \param texCoord The texture coordinates of the 4 corners of the texture290 \returns the ID of the texture287 * Loads a Font from an SDL_surface into a texture. 288 * @param surface The surface to make the texture of 289 * @param texCoord The texture coordinates of the 4 corners of the texture 290 * @returns the ID of the texture 291 291 */ 292 292 GLuint Text::loadTexture(SDL_Surface *surface, TexCoord* texCoord) … … 366 366 367 367 /** 368 \briefQuick utility function for texture creation369 \param input an integer370 \returns the next bigger 2^n-integer than input368 * Quick utility function for texture creation 369 * @param input an integer 370 * @returns the next bigger 2^n-integer than input 371 371 */ 372 372 int Text::powerOfTwo(int input) … … 385 385 //////////// 386 386 /** 387 \briefconstructs a Font388 \param fontFile the File to load the font from389 \param fontSize the Size of the Font in Pixels390 \param r Red value of the Font.391 \param g Green value of the Font.392 \param b Blue value of the Font.387 * constructs a Font 388 * @param fontFile the File to load the font from 389 * @param fontSize the Size of the Font in Pixels 390 * @param r Red value of the Font. 391 * @param g Green value of the Font. 392 * @param b Blue value of the Font. 393 393 */ 394 394 Font::Font(const char* fontFile, unsigned int fontSize, Uint8 r, Uint8 g, Uint8 b) … … 413 413 414 414 /** 415 \briefdestructs a font415 * destructs a font 416 416 */ 417 417 Font::~Font() … … 433 433 434 434 /** 435 \briefsets The Font.436 \param fontFile The file containing the font.437 \returns true if loaded, false if something went wrong, or if a font was loaded before.435 * sets The Font. 436 * @param fontFile The file containing the font. 437 * @returns true if loaded, false if something went wrong, or if a font was loaded before. 438 438 */ 439 439 bool Font::setFont(const char* fontFile) … … 462 462 463 463 /** 464 \briefsets a specific renderStyle465 \param renderStyle the Style to render: a char-array containing:464 * sets a specific renderStyle 465 * @param renderStyle the Style to render: a char-array containing: 466 466 i: italic, b: bold, u, underline 467 467 */ … … 485 485 486 486 /** 487 \briefSets a new Size to the font488 \param fontSize The new Size in pixels.487 * Sets a new Size to the font 488 * @param fontSize The new Size in pixels. 489 489 */ 490 490 void Font::setSize(unsigned int fontSize) … … 494 494 495 495 /** 496 \briefsets a new color to the font497 \param r Red498 \param g Green499 \param b Blue496 * sets a new color to the font 497 * @param r Red 498 * @param g Green 499 * @param b Blue 500 500 */ 501 501 void Font::setFastColor(Uint8 r, Uint8 g, Uint8 b) … … 507 507 508 508 /** 509 \returns the maximum height of the Font, if the font was initialized, 0 otherwise509 * @returns the maximum height of the Font, if the font was initialized, 0 otherwise 510 510 */ 511 511 int Font::getMaxHeight() … … 518 518 519 519 /** 520 \returns the maximum ascent of the Font, if the font was initialized, 0 otherwise520 * @returns the maximum ascent of the Font, if the font was initialized, 0 otherwise 521 521 522 522 the ascent is the pixels of the font above the baseline … … 531 531 532 532 /** 533 \returns the maximum descent of the Font, if the font was initialized, 0 otherwise533 * @returns the maximum descent of the Font, if the font was initialized, 0 otherwise 534 534 535 535 the descent is the pixels of the font below the baseline … … 544 544 545 545 /** 546 \param character The character to get info about.547 \returns a Glyph struct of a character. This Glyph is a pointer,546 * @param character The character to get info about. 547 * @returns a Glyph struct of a character. This Glyph is a pointer, 548 548 and MUST be deleted by the user.. 549 549 … … 581 581 582 582 this->initGlyphs(32, numberOfGlyphs); 583 this->glyphArray[32]->width = fontSize/3; //!< \todo find out the real size of a Space583 this->glyphArray[32]->width = fontSize/3; //!< @todo find out the real size of a Space 584 584 585 585 int rectSize = this->findOptimalFastTextureSize(); … … 695 695 696 696 /** 697 \briefstores Glyph Metrics in an Array.698 \param from The Glyph to start from.699 \param count The number of Glyphs to start From.697 * stores Glyph Metrics in an Array. 698 * @param from The Glyph to start from. 699 * @param count The number of Glyphs to start From. 700 700 */ 701 701 void Font::initGlyphs(Uint16 from, Uint16 count) … … 722 722 723 723 /** 724 \returns the optimal size to use as the texture size725 726 \todo: this algorithm can be a lot more faster, althought it does724 * @returns the optimal size to use as the texture size 725 726 @todo: this algorithm can be a lot more faster, althought it does 727 727 not really matter within the init-context, and 128 glyphs. 728 728 … … 773 773 774 774 /** 775 \briefa simple function to get some interesting information about this class775 * a simple function to get some interesting information about this class 776 776 */ 777 777 void Font::debug() … … 800 800 /////////////////// 801 801 /** 802 \briefstandard constructor802 * standard constructor 803 803 */ 804 804 TextEngine::TextEngine () … … 812 812 813 813 /** 814 \briefthe singleton reference to this class814 * the singleton reference to this class 815 815 */ 816 816 TextEngine* TextEngine::singletonRef = NULL; 817 817 818 818 /** 819 \briefstandard deconstructor819 * standard deconstructor 820 820 821 821 */ … … 830 830 831 831 /** 832 \brieffunction to enable TTF_Fonts832 * function to enable TTF_Fonts 833 833 */ 834 834 void TextEngine::enableFonts() … … 846 846 847 847 /** 848 \brieffunction to disable TTF_fonts848 * function to disable TTF_fonts 849 849 */ 850 850 void TextEngine::disableFonts() … … 859 859 860 860 /** 861 \briefcreates a new Text with a certain font.861 * creates a new Text with a certain font. 862 862 \see Font::Font 863 863 \see Text::Text … … 884 884 885 885 /** 886 \briefremoves a Text from the List887 \param text: the text to delete886 * removes a Text from the List 887 * @param text: the text to delete 888 888 889 889 this only ereases allocated memory, and removes the text … … 898 898 899 899 /** 900 \briefdeletes all the Text, and tries to delete all allocated fonts900 * deletes all the Text, and tries to delete all allocated fonts 901 901 */ 902 902 void TextEngine::flush() … … 913 913 914 914 /** 915 \briefdraws all the Texts that have been initialized915 * draws all the Texts that have been initialized 916 916 */ 917 917 void TextEngine::draw() const … … 937 937 938 938 /** 939 \briefoutputs some nice Debug information940 941 \todo there should also be something outputted about Font939 * outputs some nice Debug information 940 941 @todo there should also be something outputted about Font 942 942 */ 943 943 void TextEngine::debug() const … … 961 961 962 962 /** 963 \briefchecks if the compiled version and the local version of SDL_ttf match.964 \returns true if match, false otherwise963 * checks if the compiled version and the local version of SDL_ttf match. 964 * @returns true if match, false otherwise 965 965 */ 966 966 bool TextEngine::checkVersion()
Note: See TracChangeset
for help on using the changeset viewer.