Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 21, 2008, 2:35:24 PM (16 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 edited

Legend:

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

    r1604 r1614  
    3131
    3232#include <OgreOverlayManager.h>
     33#include <OgrePanelOverlayElement.h>
    3334#include "util/Convert.h"
    3435#include "core/CoreIncludes.h"
     
    4142  OrxonoxOverlay::OrxonoxOverlay()
    4243    : overlay_(0)
     44    , background_(0)
    4345    , windowAspectRatio_(1.0f)
    4446    , bCorrectAspect_(false)
     
    5052  {
    5153    RegisterObject(OrxonoxOverlay);
     54  }
     55
     56  OrxonoxOverlay::~OrxonoxOverlay()
     57  {
     58    if (this->background_)
     59      Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->background_);
    5260  }
    5361
     
    6371      this->windowResized(GraphicsEngine::getSingleton().getWindowWidth(),
    6472            GraphicsEngine::getSingleton().getWindowHeight());
     73
     74      // create background
     75      this->background_ = static_cast<Ogre::PanelOverlayElement*>(
     76          Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", getUniqueNumberStr() + "_Background"));
     77      this->overlay_->add2D(this->background_);
    6578    }
    6679
     
    7083    XMLPortParam(OrxonoxOverlay, "origin", setOrigin, getOrigin, xmlElement, mode);
    7184    XMLPortParam(OrxonoxOverlay, "position", setPosition, getPosition, xmlElement, mode);
     85    XMLPortParam(OrxonoxOverlay, "background", setBackgroundMaterial, getBackgroundMaterial, xmlElement, mode);
    7286
    7387    if (mode == XMLPort::LoadObject)
     
    8397  }
    8498
    85   OrxonoxOverlay::~OrxonoxOverlay()
     99  void OrxonoxOverlay::setBackgroundMaterial(const std::string& material)
    86100  {
     101    if (this->background_ && material != "")
     102      this->background_->setMaterialName(material);
     103  }
     104
     105  std::string OrxonoxOverlay::getBackgroundMaterial() const
     106  {
     107    if (this->background_)
     108      return this->background_->getMaterialName();
     109    else
     110      return "";
    87111  }
    88112
Note: See TracChangeset for help on using the changeset viewer.