Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/Dialog_HS16/src/modules/overlays/hud/HUDDialogue.cc @ 11317

Last change on this file since 11317 was 11317, checked in by dmoritz, 7 years ago

Picture added

File size: 1.2 KB
Line 
1
2
3#include "HUDDialogue.h"
4
5#include "core/XMLPort.h"
6
7#include <OgreCamera.h>
8#include <OgreFontManager.h>
9#include <OgreOverlayManager.h>
10#include <OgreTextAreaOverlayElement.h>
11#include <OgrePanelOverlayElement.h>
12#include "core/CoreIncludes.h"
13
14namespace orxonox
15{
16
17         RegisterClass (HUDDialogue);
18
19         HUDDialogue::HUDDialogue(Context* context) :
20        OrxonoxOverlay(context)
21    {
22        RegisterObject(HUDDialogue);
23        }     
24    void HUDDialogue::updateTarget(std::string portrait)
25    {
26        overlayElementIcon_ = static_cast<Ogre::PanelOverlayElement* >(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "Dialogue" + getUniqueNumberString()));
27        overlayElementIcon_->setPosition(0.0f,0.0f);
28        overlayElementIcon_->setDimensions(1.0f,1.0f);
29        this->background_->addChild(overlayElementIcon_);     
30
31        overlayElementIcon_->setMaterialName(portrait);
32        this->setVisible(true);
33        portraitTimer.setTimer(2.9f,false,createExecutor(createFunctor(&HUDDialogue::invisible, this)));
34    }
35    void HUDDialogue::invisible()
36    {
37        this->setVisible(false);
38        Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->overlayElementIcon_);
39    }
40         HUDDialogue::~HUDDialogue()
41         {
42
43
44         }
45}
Note: See TracBrowser for help on using the repository browser.