Changeset 7453 in orxonox.OLD for trunk/src/lib/graphics/text_engine
- Timestamp:
- Apr 29, 2006, 10:08:38 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
r7451 r7453 117 117 { 118 118 this->lineEnds.clear(); 119 this->lineEnds.push_back(0);120 119 float width = 0.0f; 121 // TODO make size local to this (not using the one from Element2D.122 120 float maxWidth = this->lineWidth / this->getSize(); 123 121 … … 133 131 width += this->getFont()->getGlyphArray()[this->getText()[i]]->advance; 134 132 } 133 this->setSizeY2D(this->lineEnds.size() * (this->lineSpacing+this->getFont()->getMaxHeight())); 135 134 } -
trunk/src/lib/graphics/text_engine/text.cc
r7450 r7453 39 39 this->blending = TEXT_DEFAULT_BLENDING; 40 40 this->color = TEXT_DEFAULT_COLOR; 41 this->setSize(TEXT_DEFAULT_SIZE);42 this->setText("");43 44 41 45 42 if (!fontFile.empty()) 46 43 this->setFont(fontFile, FONT_DEFAULT_RENDER_SIZE); 47 this->setSizeY2D(textSize); 44 45 this->setSize(TEXT_DEFAULT_SIZE); 48 46 } 49 47 … … 99 97 this->setupTextWidth(); 100 98 } 99 100 101 /** 102 * @brief sets the Size of the Font 103 * @param size :the size of the Text 104 */ 105 void Text::setSize(float size) 106 { 107 this->size = size; 108 this->setSizeY2D(size); 109 this->setupTextWidth(); 110 } 111 101 112 102 113 /** -
trunk/src/lib/graphics/text_engine/text.h
r7450 r7453 37 37 /** @param r red @param g green @param b blue @brief sets the Color of the Text to render (values in [0-1]) */ 38 38 void setColor(float r, float g, float b) { this->color = Vector(r, g, b); }; 39 /** @param size the Size of the Text @brief sets the Size of the Font */ 40 inline void setSize(float size) { this->setSizeY2D(size); }; 39 void setSize(float size); 41 40 42 41 /// RETRIEVE … … 50 49 inline const Vector& getColor() const { return this->color; }; 51 50 /** @returns the Size of the Text */ 52 inline float getSize() const { return this-> getSizeY2D(); };51 inline float getSize() const { return this->size; }; 53 52 54 53 virtual void draw() const; … … 58 57 protected: 59 58 virtual void setupTextWidth(); 59 60 60 private: 61 61 Font* font; //!< Font of this text … … 64 64 Vector color; //!< The color of the font. 65 65 float blending; //!< The blending intensity. 66 float size; //!< The size of the Text. 66 67 }; 67 68
Note: See TracChangeset
for help on using the changeset viewer.