Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 5, 2016, 3:59:27 PM (7 years ago)
Author:
dmoritz
Message:

Picture added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/Dialog_HS16/src/modules/overlays/hud/HUDDialogue.cc

    r11292 r11317  
    1 
    2 
    3 
    41
    52
     
    1310#include <OgreTextAreaOverlayElement.h>
    1411#include <OgrePanelOverlayElement.h>
     12#include "core/CoreIncludes.h"
    1513
    1614namespace orxonox
     
    2321    {
    2422        RegisterObject(HUDDialogue);
    25 
    26         overlayElementIcon_ = static_cast<Ogre::PanelOverlayElement* >(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "Dialogue" + getUniqueNumberString()));
     23        }     
     24    void HUDDialogue::updateTarget(std::string portrait)
     25    {
     26        overlayElementIcon_ = static_cast<Ogre::PanelOverlayElement* >(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "Dialogue" + getUniqueNumberString()));
    2727        overlayElementIcon_->setPosition(0.0f,0.0f);
    2828        overlayElementIcon_->setDimensions(1.0f,1.0f);
    29         this->background_->addChild(overlayElementIcon_);
     29        this->background_->addChild(overlayElementIcon_);     
    3030
    31         overlayElementIcon_->setMaterialName("Orxonox/DialogueHUD_Person");
    32 
    33            }     
    34 
    35         void HUDDialogue::tick(float dt)
     31        overlayElementIcon_->setMaterialName(portrait);
     32        this->setVisible(true);
     33        portraitTimer.setTimer(2.9f,false,createExecutor(createFunctor(&HUDDialogue::invisible, this)));
     34    }
     35    void HUDDialogue::invisible()
    3636    {
    37         SUPER(HUDDialogue, tick, dt);
    38 
    39 
     37        this->setVisible(false);
     38        Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->overlayElementIcon_);
    4039    }
    41 
    4240         HUDDialogue::~HUDDialogue()
    4341         {
     
    4543
    4644         }
    47 
    48          void HUDDialogue::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    49          {
    50                 SUPER(HUDDialogue, XMLPort, xmlelement, mode);
    51          }
    52 
    5345}
Note: See TracChangeset for help on using the changeset viewer.