Changeset 982 for code/branches/hud
- Timestamp:
- Apr 3, 2008, 2:54:45 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/hud/src/orxonox/Orxonox.cc
r825 r982 52 52 #include <iostream> 53 53 #include <exception> 54 #include <string.h> 54 55 55 56 //***** ORXONOX **** … … 392 393 // cont->addChild(newBar-> element_); 393 394 // 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 Bar* newBar = static_cast<Bar*>(overlayManager.createOverlayElement("Panel", "Bar"));395 396 397 // Ogre::OverlayManager& overlayManager = Ogre::OverlayManager::getSingleton(); 398 399 // Ogre::Overlay* hudOverlay = overlayManager.create("orxonoxsuperoverlay"); 400 401 /* Bar* newBar = static_cast<Bar*>(overlayManager.createOverlayElement("Panel", "Bar")); 401 402 newBar->setLeft(0); 402 403 newBar->setTop(0); 403 newBar->setWidth(10 );404 newBar->setWidth(100); 404 405 newBar->setHeight(10); 405 406 newBar->setMaterialName("Orxonox/Red"); 406 newBar->setMetricsMode(Ogre::GMM_PIXELS); 407 newBar->setPercentage( (Ogre::Real)0.8);407 newBar->setMetricsMode(Ogre::GMM_PIXELS); 408 newBar->setPercentage(0.5); 408 409 newBar->show(); 409 410 411 Ogre::OverlayContainer* panel = static_cast<Ogre::OverlayContainer*> (overlayManager.createOverlayElement("Panel", "PanelName")); 410 411 */ 412 /* 413 Bar* newBar; 414 newBar = new Bar(0,0,100,10,Bar::LEFT, Bar::RED,"hallo"); 415 newBar->reset(50); 416 417 Bar* newBar2; 418 newBar2 = new Bar(0,20,100,10,Bar::UP,Bar::GREEN,"hallo2"); 419 newBar2->reset(50); 420 421 Bar* newBar3; 422 newBar3 = new Bar(0,40,100,10,Bar::RIGHT,Bar::RED,"hallo3"); 423 newBar3->reset(50); 424 425 Bar* newBar4; 426 newBar4 = new Bar(0,60,100,10,Bar::DOWN,Bar::YELLOW,"hallo4"); 427 newBar4->reset(50); 428 newBar4->hide(); 429 newBar4->show(); 430 431 SmartBar* newBar5; 432 newBar5 = new SmartBar(0,80,100,10,Bar::DOWN,"hallo5"); 433 434 SmartBar* newBar6; 435 newBar6 = new SmartBar(50,80,100,10,Bar::DOWN,"hallo6"); 436 437 newBar5->reset(56); 438 439 440 */ 441 /* 442 Ogre::OverlayElement* element = overlayManager.createOverlayElement("Panel",s); 443 element->setLeft(0); 444 element->setTop(0); 445 element->setWidth(100); 446 element->setHeight(10); 447 element->setMaterialName("Orxonox/Red"); 448 element->setMetricsMode(Ogre::GMM_PIXELS); 449 */ 450 /* Ogre::OverlayContainer* panel = static_cast<Ogre::OverlayContainer*> (overlayManager.createOverlayElement("Panel", "PanelName")); 412 451 panel->setLeft(10); 413 452 panel->setTop(10); 414 453 panel->setWidth(100); 415 454 panel->setHeight(100); 416 panel->setMetricsMode(Ogre::GMM_PIXELS); 455 panel->setMetricsMode(Ogre::GMM_PIXELS); 417 456 panel->show(); 418 457 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); 426 hudOverlay->show(); 458 459 if(dynamic_cast<Ogre::TextAreaOverlayElement*> (overlayManager.createOverlayElement("TextArea", "hallo7"))!= NULL ){panel->addChild(newBar5->element);} 460 461 Ogre::TextAreaOverlayElement* newEle = dynamic_cast<Ogre::TextAreaOverlayElement*> (overlayManager.createOverlayElement("TextArea", "hallo8")); 462 newEle->setColour(Ogre::ColourValue::Blue); 463 newEle->setCaption("hallo"); 464 newEle->setPosition(0,0); 465 newEle->setDimensions(0,0); 466 newEle->setHorizontalAlignment(Ogre::GHA_LEFT); 467 // newEle->setMaterialName("Orxonox/Red"); 468 newEle->setCharHeight(18); 469 newEle->setFontName("BlueHighway"); 470 // newEle->setMetricsMode(Ogre::GMM_PIXELS); 471 472 473 Ogre::OverlayElement* newEle2 =Ogre:: OverlayManager::getSingleton().getOverlayElement("Orxonox/HUD1.2/RocketNum1"); 474 newEle2->setColour(Ogre::ColourValue::Red); 475 newEle2->setCaption("hallo"); 476 newEle2->setPosition(-50,0); 477 newEle2->setDimensions(0,0); 478 // newEle->setMaterialName("Orxonox/Red"); 479 // newEle2->setCharHeight(18); 480 // newEle2->setFontName("BlueHighway"); 481 // newEle2->setMetricsMode(Ogre::GMM_PIXELS); 482 483 484 panel->addChild(newEle2); 485 486 */ 487 488 489 // hudOverlay->add2D(panel); 490 /* panel->addChild(newBar->element); 491 panel->addChild(newBar2->element); 492 panel->addChild(newBar3->element); 493 panel->addChild(newBar4->element); 494 panel->addChild(newBar5->element); 495 panel->addChild(newBar6->element); 496 */// panel->addChild(newEle); 497 498 499 500 // HUD2* orxonoxHud; 501 // orxonoxHud = new HUD2(); 502 // orxonoxHud->setEnergyValue(20); 503 // orxonoxHud->setEnergyDistr(20,20,60); 504 // hudOverlay->show(); 505 506 HUD* orxonoxHUD = new HUD(1); 427 507 428 508
Note: See TracChangeset
for help on using the changeset viewer.