Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 21, 2008, 2:35:24 PM (17 years ago)
Author:
rgrieder
Message:
  • Dots on the Radar actually disappear now when a Ship gets destroyed…
  • svn save to keep History of HUDText when renaming AND moving
File:
1 moved

Legend:

Unmodified
Added
Removed
  • code/branches/hud/src/orxonox/overlays/HUDText.cc

    r1604 r1614  
    3131
    3232#include <OgreOverlayManager.h>
     33#include <OgreTextAreaOverlayElement.h>
     34#include <OgrePanelOverlayElement.h>
    3335
    3436#include "util/Convert.h"
     
    4143
    4244  HUDText::HUDText()
    43     : background_(0)
    44     , text_(0)
     45    : text_(0)
    4546  {
    4647    RegisterObject(HUDText);
     
    5354      if (this->text_)
    5455          OverlayManager::getSingleton().destroyOverlayElement(this->text_);
    55       if (this->background_)
    56           OverlayManager::getSingleton().destroyOverlayElement(this->background_);
    5756    }
    5857  }
     
    6463    if (mode == XMLPort::LoadObject)
    6564    {
    66       // create background
    67       this->background_ = static_cast<PanelOverlayElement*>(
    68               OverlayManager::getSingleton().createOverlayElement("Panel", getName() + "_Background"));
    69 
    7065      this->text_ = static_cast<TextAreaOverlayElement*>(Ogre::OverlayManager::getSingleton().createOverlayElement("TextArea", getName() + "_Text"));
    7166      this->text_->setCharHeight(1.0f);
    7267      this->text_->setFontName("Monofur");
    7368
    74       this->overlay_->add2D(this->background_);
    7569      this->background_->addChild(this->text_);
    7670    }
    7771
    78     XMLPortParam(HUDText, "material", setBackgroundMaterial, getBackgroundMaterial, xmlElement, mode);
    7972    XMLPortParam(HUDText, "font", setFont, getFont, xmlElement, mode);
    8073    XMLPortParam(HUDText, "caption", setCaption, getCaption, xmlElement, mode);
     
    8477      this->text_->setCaption(this->caption_);
    8578    }
    86   }
    87 
    88   void HUDText::setBackgroundMaterial(const std::string& material)
    89   {
    90     if (this->background_ && material != "")
    91       this->background_->setMaterialName(material);
    92   }
    93 
    94   std::string HUDText::getBackgroundMaterial() const
    95   {
    96     if (this->background_)
    97       return this->background_->getMaterialName();
    98     else
    99       return "";
    10079  }
    10180
Note: See TracChangeset for help on using the changeset viewer.