Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 823 for code/branches


Ignore:
Timestamp:
Feb 17, 2008, 5:42:44 PM (17 years ago)
Author:
nicolasc
Message:

added chai's hud

Location:
code/branches/hud
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/hud/cmake/FindOGRE.cmake

    r790 r823  
    77#  OGRE_FOUND, If false, do not try to use OGRE
    88#
    9 # Copyright © 2007, Matt Williams
     9# Copyright 2007, Matt Williams
    1010# Modified by Nicolas Schlumberger to make it work on the Tardis-Infrastucture of the ETH Zurich
    1111#
     
    1818IF (WIN32) #Windows
    1919    MESSAGE(STATUS "Looking for OGRE")
    20     SET(OGRE_INCLUDE_DIR ../libs/ogre/OgreMain/include)
    21     SET(OGRE_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../libs/ogre/Samples/Common/bin/Release)
     20    SET(OGRE_INCLUDE_DIR /usr/include/OGRE ../libs/ogre/OgreMain/include)
     21    SET(OGRE_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/usr/include/OGRE ${CMAKE_CURRENT_SOURCE_DIR}/../libs/ogre/Samples/Common/bin/Release)
    2222    SET(OGRE_LIBRARIES debug OgreMain_d optimized OgreMain)
    2323ELSE (WIN32) #Unix
    2424    FIND_PACKAGE(PkgConfig)
    25     PKG_SEARCH_MODULE(OGRE OGRE /usr/pack/ogre-1.4.5-sd/i686-debian-linux3.1/lib/pkgconfig/OGRE.pc) # tardis specific hack
     25    PKG_SEARCH_MODULE(OGRE OGRE /usr/include/OGRE /usr/pack/ogre-1.4.5-sd/i686-debian-linux3.1/lib/pkgconfig/OGRE.pc) # tardis specific hack
    2626    SET(OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIRS})
    2727    SET(OGRE_LIB_DIR ${OGRE_LIBDIR})
  • code/branches/hud/src/orxonox/Orxonox.cc

    r790 r823  
    4343#include <OgreConfigFile.h>
    4444#include <OgreOverlay.h>
     45#include <OgreOverlayContainer.h>
    4546#include <OgreOverlayManager.h>
    4647
     
    7374#include "core/Debug.h"
    7475#include "hud/HUD.h"
     76#include "hud/Bar.h"
    7577#include "objects/weapon/BulletManager.h"
    7678#include "GraphicsEngine.h"
     
    382384    loader_->loadLevel();
    383385
    384     Ogre::Overlay* hudOverlay = Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2");
    385     HUD* orxonoxHud;
    386     orxonoxHud = new HUD();
    387     orxonoxHud->setEnergyValue(20);
    388     orxonoxHud->setEnergyDistr(20,20,60);
     386//    Ogre::Overlay* hudOverlay = Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2");
     387 //   Ogre::OverlayContainer* cont = Ogre::OverlayManager::createOverlayElement("Orxonox/HUD1.2/MyShip", "Orxonox/HUD1.2/shieldLeftTop", false);
     388 //   Ogre::OverlayContainer* cont =  Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2/MapBackGround");
     389
     390//    hud::Bar* newBar = Ogre::OverlayManager::createOverlayElement("Element", "ElementName");
     391//new hud::Bar(1,true,Ogre::ColourValue::Black,"Orxonox/hi");
     392 //   cont->addChild(newBar-> element_);
     393//   hud::Bar* newBar = Ogre::OverlayManager::createOverlayElement("orxonox/bar", "orxonox/newbar", false);
     394
     395
     396    Ogre::OverlayManager& overlayManager = Ogre::OverlayManager::getSingleton();
     397
     398    Ogre::Overlay* hudOverlay = overlayManager.create("orxonoxsuperoverlay");
     399
     400    hud::Bar* newBar = static_cast<hud::Bar*>(overlayManager.createOverlayElement("Panel", "Bar"));
     401    newBar->setLeft(0);
     402    newBar->setTop(0);
     403    newBar->setWidth(10);
     404    newBar->setHeight(10);
     405    newBar->setMaterialName("Orxonox/Red");
     406    newBar->setMetricsMode(Ogre::GMM_PIXELS);
     407    newBar->setPercentage(0.8);
     408    newBar->show();
     409
     410
     411    Ogre::OverlayContainer* panel = static_cast<Ogre::OverlayContainer*> (overlayManager.createOverlayElement("Panel", "PanelName"));
     412    panel->setLeft(10);
     413    panel->setTop(10);
     414    panel->setWidth(100);
     415    panel->setHeight(100);
     416    panel->setMetricsMode(Ogre::GMM_PIXELS);
     417    panel->show();
     418
     419    hudOverlay->add2D(panel);
     420    panel->addChild(newBar);
     421
     422 //   HUD* orxonoxHud;
     423 //   orxonoxHud = new HUD();
     424 //   orxonoxHud->setEnergyValue(20);
     425 //   orxonoxHud->setEnergyDistr(20,20,60);
    389426    hudOverlay->show();
     427
    390428
    391429        /*
  • code/branches/hud/src/orxonox/hud/HUD.cc

    r790 r823  
    3333
    3434#include "HUD.h"
     35#include "Bar.h"
    3536
    3637
Note: See TracChangeset for help on using the changeset viewer.