Changeset 1590 for code/branches/hud/src/orxonox/hud/HUDText.cc
- Timestamp:
- Jun 12, 2008, 12:57:45 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/hud/src/orxonox/hud/HUDText.cc
r1588 r1590 62 62 HUDOverlay::XMLPort(xmlElement, mode); 63 63 64 // create background 65 this->background_ = static_cast<PanelOverlayElement*>( 66 OverlayManager::getSingleton().createOverlayElement("Panel", getName() + "_Background")); 67 this->background_->setMetricsMode(GMM_RELATIVE); 68 this->background_->setDimensions(1.0f, 1.0f); 69 this->background_->setPosition(0.0f, 0.0f); 64 if (mode == XMLPort::LoadObject) 65 { 66 // create background 67 this->background_ = static_cast<PanelOverlayElement*>( 68 OverlayManager::getSingleton().createOverlayElement("Panel", getName() + "_Background")); 69 this->background_->setMetricsMode(GMM_RELATIVE); 70 this->background_->setDimensions(1.0f, 1.0f); 71 this->background_->setPosition(0.0f, 0.0f); 70 72 71 this->text_ = static_cast<TextAreaOverlayElement*>(Ogre::OverlayManager::getSingleton().createOverlayElement("TextArea", getName() + "_Text"));72 this->text_->setMetricsMode(Ogre::GMM_RELATIVE);73 this->text_->setDimensions(1.0f, 1.0f);74 this->text_->setPosition(0.0f, 0.0f);75 this->text_->setCharHeight(1.0f);73 this->text_ = static_cast<TextAreaOverlayElement*>(Ogre::OverlayManager::getSingleton().createOverlayElement("TextArea", getName() + "_Text")); 74 this->text_->setMetricsMode(Ogre::GMM_RELATIVE); 75 this->text_->setPosition(0.0f, 0.0f); 76 this->text_->setCharHeight(1.0f); 77 this->text_->setFontName("Monofur"); 76 78 77 this->overlay_->add2D(this->background_); 78 this->background_->addChild(this->text_); 79 this->overlay_->add2D(this->background_); 80 this->background_->addChild(this->text_); 81 } 79 82 80 83 XMLPortParam(HUDText, "material", setBackgroundMaterial, getBackgroundMaterial, xmlElement, mode); … … 82 85 XMLPortParam(HUDText, "caption", setCaption, getCaption, xmlElement, mode); 83 86 84 this->text_->setCaption(this->caption_); 87 if (mode == XMLPort::LoadObject) 88 { 89 this->text_->setCaption(this->caption_); 90 } 85 91 } 86 92
Note: See TracChangeset
for help on using the changeset viewer.