Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 26, 2008, 7:00:59 PM (16 years ago)
Author:
rgrieder
Message:

some adjustment to the default value setting in the overlay files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/overlays/OverlayText.cc

    r1625 r1627  
    5757    void OverlayText::XMLPort(Element& xmlElement, XMLPort::Mode mode)
    5858    {
    59         if (mode == XMLPort::LoadObject)
    60         {
    61             // setting this to true makes the text more readable when the
    62             // resolution aspect is far from 1.0
    63             this->bCorrectAspect_ = true; // can be overridden by xml
    64         }
    65 
    6659        OrxonoxOverlay::XMLPort(xmlElement, mode);
    6760
     
    7063            this->text_ = static_cast<Ogre::TextAreaOverlayElement*>(Ogre::OverlayManager::getSingleton()
    7164                .createOverlayElement("TextArea", "OverlayText_text_" + getUniqueNumberStr()));
    72             this->text_->setCharHeight(1.0f);
    73             this->text_->setFontName("Monofur");
    7465
    7566            this->background_->addChild(this->text_);
     67
     68            this->setFont("Monofur");
     69            this->caption_ = "";
     70            this->setTextSize(1.0f);
    7671        }
    7772
    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);
    8676    }
    8777
     
    10292    void OverlayText::sizeChanged()
    10393    {
     94        if (!this->overlay_)
     95            return;
     96
    10497        this->overlay_->setScale(size_.y * sizeCorrection_.y, size_.y * sizeCorrection_.y);
    10598        positionChanged();
Note: See TracChangeset for help on using the changeset viewer.