Changeset 3196 for code/trunk/src/orxonox/overlays/OverlayText.cc
- Timestamp:
- Jun 20, 2009, 9:20:47 AM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/pch (added) merged: 3114-3118,3124-3125,3127-3131,3133,3138-3194
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/overlays/OverlayText.cc
r3110 r3196 31 31 #include <OgreOverlayManager.h> 32 32 #include <OgrePanelOverlayElement.h> 33 #include <OgreTextAreaOverlayElement.h> 34 #include <boost/static_assert.hpp> 33 35 34 36 #include "util/String.h" … … 36 38 #include "core/XMLPort.h" 37 39 40 38 41 namespace orxonox 39 42 { 40 43 CreateFactory(OverlayText); 44 45 BOOST_STATIC_ASSERT((int)Ogre::TextAreaOverlayElement::Left == (int)OverlayText::Left); 46 BOOST_STATIC_ASSERT((int)Ogre::TextAreaOverlayElement::Center == (int)OverlayText::Center); 47 BOOST_STATIC_ASSERT((int)Ogre::TextAreaOverlayElement::Right == (int)OverlayText::Right); 41 48 42 49 OverlayText::OverlayText(BaseObject* creator) … … 76 83 } 77 84 78 void OverlayText::setFont(const std::string& font)79 {80 if (font != "")81 this->text_->setFontName(font);82 }83 84 85 void OverlayText::setAlignmentString(const std::string& alignment) 85 86 { 86 87 if (alignment == "right") 87 this->setAlignment(O gre::TextAreaOverlayElement::Right);88 this->setAlignment(OverlayText::Right); 88 89 else if (alignment == "center") 89 this->setAlignment(O gre::TextAreaOverlayElement::Center);90 this->setAlignment(OverlayText::Center); 90 91 else // "left" and default 91 this->setAlignment(O gre::TextAreaOverlayElement::Left);92 this->setAlignment(OverlayText::Left); 92 93 } 93 94 … … 120 121 positionChanged(); 121 122 } 123 124 void OverlayText::setCaption(const std::string& caption) 125 { 126 this->text_->setCaption(caption); 127 this->changedCaption(); 128 } 129 std::string OverlayText::getCaption() const 130 { 131 return this->text_->getCaption(); 132 } 133 134 void OverlayText::setFont(const std::string& font) 135 { 136 if (font != "") 137 this->text_->setFontName(font); 138 } 139 const std::string& OverlayText::getFont() const 140 { 141 return this->text_->getFontName(); 142 } 143 144 void OverlayText::setSpaceWidth(float width) 145 { 146 this->text_->setSpaceWidth(width); 147 } 148 float OverlayText::getSpaceWidth() const 149 { 150 return this->text_->getSpaceWidth(); 151 } 152 153 void OverlayText::setColour(const ColourValue& colour) 154 { 155 this->text_->setColour(colour); this->changedColour(); 156 } 157 const ColourValue& OverlayText::getColour() const 158 { 159 return this->text_->getColour(); 160 } 161 162 void OverlayText::setAlignment(OverlayText::Alignment alignment) 163 { 164 this->text_->setAlignment(static_cast<Ogre::TextAreaOverlayElement::Alignment>(alignment)); 165 } 166 OverlayText::Alignment OverlayText::getAlignment() const 167 { 168 return static_cast<OverlayText::Alignment>(this->text_->getAlignment()); 169 } 122 170 }
Note: See TracChangeset
for help on using the changeset viewer.