Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 991 for code/branches/hud2/src


Ignore:
Timestamp:
Apr 4, 2008, 12:10:58 PM (17 years ago)
Author:
rgrieder
Message:
  • added the hud files and edited the CMLs
Location:
code/branches/hud2/src/orxonox
Files:
8 added
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/hud2/src/orxonox/CMakeLists.txt

    r971 r991  
    55#  SpaceshipSteering.cc
    66  hud/HUD.cc
     7  hud/Bar.cc
    78  particle/ParticleInterface.cc
    89  tools/BillboardSet.cc
     
    4647)
    4748
     49
  • code/branches/hud2/src/orxonox/Orxonox.cc

    r973 r991  
    255255    bulletMgr_ = new BulletManager();
    256256   
    257     Ogre::Overlay* hudOverlay = Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2");
    258     HUD* orxonoxHud;
    259     orxonoxHud = new HUD();
    260     orxonoxHud->setEnergyValue(20);
    261     orxonoxHud->setEnergyDistr(20,20,60);
    262     hudOverlay->show();
     257    //Ogre::Overlay* hudOverlay = Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2");
     258    //HUD* orxonoxHud;
     259    orxonoxHUD_ = new HUD(1);
     260    //orxonoxHud->setEnergyValue(20);
     261    //orxonoxHud->setEnergyDistr(20,20,60);
     262    //hudOverlay->show();
    263263   
    264264    client_g->establishConnection();
     
    306306    Loader::open(startlevel);
    307307
    308     Ogre::Overlay* hudOverlay = Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2");
    309     orxonoxHUD_ = new HUD();
    310     orxonoxHUD_->setEnergyValue(20);
    311     orxonoxHUD_->setEnergyDistr(20,20,60);
    312     hudOverlay->show();
     308    //Ogre::Overlay* hudOverlay = Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2");
     309    orxonoxHUD_ = new HUD(1);
     310    //orxonoxHUD_->setEnergyValue(20);
     311    //orxonoxHUD_->setEnergyDistr(20,20,60);
     312    //hudOverlay->show();
    313313
    314314        /*
     
    374374
    375375      // show the current time in the HUD
    376       orxonoxHUD_->setTime((int)now, 0);
     376      //orxonoxHUD_->setTime((int)now, 0);
     377      orxonoxHUD_->energyCounter->reset(20);
     378
    377379
    378380      // Iterate through all Tickables and call their tick(dt) function
  • code/branches/hud2/src/orxonox/hud/HUD.cc

    r790 r991  
    2626*/
    2727
     28
    2829#include "OrxonoxStableHeaders.h"
     30#include <OgreOverlay.h>
     31#include <OgreOverlayContainer.h>
     32#include <OgreOverlayManager.h>
     33
     34#include "HUD.h"
     35#include "Bar.h"
     36
     37
     38namespace orxonox
     39{
     40  using namespace Ogre;
     41
     42
     43
     44
     45
     46  HUD::HUD(int zoom){
     47
     48    Ogre::OverlayManager& overlayManager = Ogre::OverlayManager::getSingleton();
     49
     50    energyCounter = new Bar(0,0,100,20,Bar::LEFT,Bar::YELLOW,"Orxonox/HUD/energyCounterPanel/energyCounter");
     51
     52    Ogre::OverlayContainer* energyCounterPanel = static_cast<Ogre::OverlayContainer*>(overlayManager.createOverlayElement("Panel", "Orxonox/HUD/energyCounterPanel"));
     53    energyCounterPanel->setLeft(-50);
     54    energyCounterPanel->setTop(10);
     55    energyCounterPanel->setWidth(100);
     56    energyCounterPanel->setHeight(20);
     57    energyCounterPanel->setHorizontalAlignment(Ogre::GHA_CENTER);
     58    energyCounterPanel->setMetricsMode(Ogre::GMM_PIXELS);       
     59    energyCounterPanel->show();
     60    energyCounterPanel->addChild(energyCounter->element);
     61
     62    Ogre::Overlay* orxonoxOverlay = overlayManager.create("Orxonox/HUD");
     63    orxonoxOverlay->add2D(energyCounterPanel);
     64    orxonoxOverlay->show();
     65  }
     66
     67  HUD::~HUD(void){}
     68
     69
     70
     71}
     72
     73
     74
     75
     76
     77
     78/*#include "OrxonoxStableHeaders.h"
    2979
    3080#include <OgreOverlayManager.h>
     
    3383
    3484#include "HUD.h"
    35 
     85#include "Bar.h"
    3686
    3787namespace orxonox
     
    50100    setTargetWindowDistance(30);
    51101
    52     setEnergyValue(60.0);
     102    setEnergyValue(60);
    53103
    54104    setShieldLeftTopValue(true);
     
    68118    energyDistrPixelX_ = 100;
    69119    energyDistrPixelY_ = 86;
     120
    70121
    71122  }
     
    217268
    218269}
     270*/
  • code/branches/hud2/src/orxonox/hud/HUD.h

    r790 r991  
    2626*/
    2727
     28
    2829#ifndef _HUD_H__
     30#define _HUD_H__
     31
     32#include <string.h>
     33#include <OgreOverlayElement.h>
     34#include <OgreTextAreaOverlayElement.h>
     35#include <OgrePrerequisites.h>
     36#include "../OrxonoxPrereqs.h"
     37
     38#include "Bar.h"
     39
     40
     41namespace orxonox
     42{
     43  class _OrxonoxExport HUD
     44  {
     45  private:
     46
     47  public:
     48    HUD(int zoom);
     49    ~HUD();
     50
     51    Bar* energyCounter;
     52  };
     53}       
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63#endif _HUD_H_
     64
     65/*#ifndef _HUD_H__
    2966#define _HUD_H__
    3067
Note: See TracChangeset for help on using the changeset viewer.