Changeset 1627 for code/trunk/src/orxonox/overlays/OverlayText.cc
- Timestamp:
- Jun 26, 2008, 7:00:59 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/overlays/OverlayText.cc
r1625 r1627 57 57 void OverlayText::XMLPort(Element& xmlElement, XMLPort::Mode mode) 58 58 { 59 if (mode == XMLPort::LoadObject)60 {61 // setting this to true makes the text more readable when the62 // resolution aspect is far from 1.063 this->bCorrectAspect_ = true; // can be overridden by xml64 }65 66 59 OrxonoxOverlay::XMLPort(xmlElement, mode); 67 60 … … 70 63 this->text_ = static_cast<Ogre::TextAreaOverlayElement*>(Ogre::OverlayManager::getSingleton() 71 64 .createOverlayElement("TextArea", "OverlayText_text_" + getUniqueNumberStr())); 72 this->text_->setCharHeight(1.0f);73 this->text_->setFontName("Monofur");74 65 75 66 this->background_->addChild(this->text_); 67 68 this->setFont("Monofur"); 69 this->caption_ = ""; 70 this->setTextSize(1.0f); 76 71 } 77 72 78 XMLPortParam(OverlayText, "font", setFont, getFont, xmlElement, mode); 79 XMLPortParam(OverlayText, "caption", setCaption, getCaption, xmlElement, mode); 80 XMLPortParam(OverlayText, "textSize", setTextSize, getTextSize, xmlElement, mode); 81 82 if (mode == XMLPort::LoadObject) 83 { 84 this->text_->setCaption(this->caption_); 85 } 73 XMLPortParam(OverlayText, "font", setFont, getFont, xmlElement, mode).defaultValues("Monofur"); 74 XMLPortParam(OverlayText, "caption", setCaption, getCaption, xmlElement, mode).defaultValues(""); 75 XMLPortParam(OverlayText, "textSize", setTextSize, getTextSize, xmlElement, mode).defaultValues(1.0f); 86 76 } 87 77 … … 102 92 void OverlayText::sizeChanged() 103 93 { 94 if (!this->overlay_) 95 return; 96 104 97 this->overlay_->setScale(size_.y * sizeCorrection_.y, size_.y * sizeCorrection_.y); 105 98 positionChanged();
Note: See TracChangeset
for help on using the changeset viewer.