Changeset 3845 in orxonox.OLD for orxonox/trunk/src/lib/graphics
- Timestamp:
- Apr 17, 2005, 1:19:54 AM (20 years ago)
- Location:
- orxonox/trunk/src/lib/graphics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/text_engine.cc
r3844 r3845 138 138 \param alignment the alignment to set 139 139 */ 140 void Text::setAlignment(TEXT_ALIGNMENT align emnt)140 void Text::setAlignment(TEXT_ALIGNMENT alignment) 141 141 { 142 142 this->alignment = alignment; … … 185 185 // setting the Position of this Text. 186 186 Vector pos; 187 if (this->bindNode) 187 if (this->alignment == TEXT_ALIGN_SCREEN_CENTER) 188 { 189 pos.x = GraphicsEngine::getInstance()->getResolutionX()/2 + this->posSize.x; 190 pos.y = GraphicsEngine::getInstance()->getResolutionY()/2 + this->posSize.y; 191 pos.z = 0; 192 } 193 else if (this->bindNode) 188 194 { 189 195 GLdouble x = this->bindNode->getAbsCoor().x; … … 211 217 if (this->alignment == TEXT_ALIGN_RIGHT) 212 218 glTranslatef(-this->posSize.w, 0, 0); 213 else if (this->alignment == TEXT_ALIGN_CENTER )219 else if (this->alignment == TEXT_ALIGN_CENTER || this->alignment == TEXT_ALIGN_SCREEN_CENTER) 214 220 glTranslatef(-this->posSize.w/2, 0, 0); 215 221 -
orxonox/trunk/src/lib/graphics/text_engine.h
r3843 r3845 30 30 31 31 //! An enumerator for the text alignment. 32 enum TEXT_ALIGNMENT {TEXT_ALIGN_LEFT, TEXT_ALIGN_RIGHT, TEXT_ALIGN_CENTER };32 enum TEXT_ALIGNMENT {TEXT_ALIGN_LEFT, TEXT_ALIGN_RIGHT, TEXT_ALIGN_CENTER, TEXT_ALIGN_SCREEN_CENTER}; 33 33 34 34 /* some default values */ … … 104 104 void setText(const char* text); 105 105 void setPosition(int x, int y); 106 void setAlignment(TEXT_ALIGNMENT align emnt);106 void setAlignment(TEXT_ALIGNMENT alignment); 107 107 /** \param blending the blending intensity to set (between 0.0 and 1.0) */ 108 108 inline void setBlending(float blending) {this->blending = blending;}
Note: See TracChangeset
for help on using the changeset viewer.