Changeset 10716 in orxonox.OLD
- Timestamp:
- Jun 18, 2007, 4:06:03 PM (17 years ago)
- Location:
- branches/presentation/src/util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/presentation/src/util/hud.cc
r10698 r10716 58 58 this->resY = 1; 59 59 60 this->overlayPercentage = 40; 61 this->overlayActive = false; 62 this->rightRect = new OrxGui::GLGuiImage(); 63 this->leftRect = new OrxGui::GLGuiImage(); 64 this->topRect = new OrxGui::GLGuiImage(); 65 this->bottomRect = new OrxGui::GLGuiImage(); 66 this->middleRect = new OrxGui::GLGuiImage(); 67 68 this->inputLine = new OrxGui::GLGuiInputLine(); 69 //this->inputLine->setParent2D(this); 70 this->notifier = new OrxGui::GLGuiNotifier(); 71 this->notifier->setParent2D(this->bottomRect); 72 notifier->setRelCoor2D(5,5); 60 this->init(); 73 61 74 this->barSocket = new OrxGui::GLGuiImage();75 this->barSocket->setParent2D(this->bottomRect);76 77 this->_radar = new OrxGui::GLGuiRadar();78 this->radarCenterNode = NULL;79 80 this->subscribeEvent(ES_ALL, EV_VIDEO_RESIZE);81 this->subscribeEvent(ES_ALL, SDLK_TAB);82 83 //this->shipValuesBox = NULL;84 62 } 85 63 … … 100 78 delete this->bottomRect; 101 79 delete this->middleRect; 80 102 81 103 82 //if (this->shipValuesBox != NULL) … … 105 84 106 85 // delete what has to be deleted here 86 } 87 88 void Hud::init() 89 { 90 this->overlayPercentage = 40; 91 this->overlayActive = false; 92 this->rightRect = new OrxGui::GLGuiImage(); 93 this->leftRect = new OrxGui::GLGuiImage(); 94 this->topRect = new OrxGui::GLGuiImage(); 95 this->bottomRect = new OrxGui::GLGuiImage(); 96 this->middleRect = new OrxGui::GLGuiImage(); 97 98 this->inputLine = new OrxGui::GLGuiInputLine(); 99 this->inputLine->setParent2D(this); 100 this->notifier = new OrxGui::GLGuiNotifier(); 101 this->notifier->setParent2D(this); 102 notifier->setAbsCoor2D(100,100); 103 104 this->barSocket = new OrxGui::GLGuiImage(); 105 this->barSocket->setParent2D(this->bottomRect); 106 107 this->_radar = new OrxGui::GLGuiRadar(); 108 this->radarCenterNode = NULL; 109 110 this->subscribeEvent(ES_ALL, EV_VIDEO_RESIZE); 111 this->subscribeEvent(ES_ALL, SDLK_TAB); 112 113 if (this->playmode == FirstPerson) 114 { 115 this->topHit = new OrxGui::GLGuiImage(); 116 this->topHit->loadImageFromFile("textures/gui/gui_hitbar.png"); 117 this->topHit->setParent2D(this->middleRect); 118 this->topHit->setRelDir2D(-1.5708); 119 120 this->bottomHit = new OrxGui::GLGuiImage(); 121 this->bottomHit->loadImageFromFile("textures/gui/gui_hitbar.png"); 122 this->bottomHit->setParent2D(this->middleRect); 123 this->bottomHit->setRelDir2D(1.5708); 124 125 this->leftHit = new OrxGui::GLGuiImage(); 126 this->leftHit->loadImageFromFile("textures/gui/gui_hitbar.png"); 127 this->leftHit->setParent2D(this->middleRect); 128 129 this->rightHit = new OrxGui::GLGuiImage(); 130 this->rightHit->loadImageFromFile("textures/gui/gui_hitbar.png"); 131 this->rightHit->setParent2D(this->middleRect); 132 this->rightHit->setRelDir2D(3.1416); 133 134 this->leftRect->setParent2D(this); 135 this->rightRect->setParent2D(this); 136 } 137 138 //this->shipValuesBox = NULL; 107 139 } 108 140 … … 321 353 */ 322 354 355 void Hud::setMode(Hud::Playmode playmode) 356 { 357 this->playmode = playmode; 358 this->init(); 359 } 360 323 361 void Hud::updateWeaponManager() 324 362 { … … 390 428 this->resY = State::getResY(); 391 429 392 this->setSize2D( .2 *this->resX, this->resY);430 this->setSize2D(this->resX, this->resY); 393 431 if( this->playmode != FirstPerson ) 394 432 { … … 410 448 if( this->playmode != FirstPerson ) 411 449 { 412 this->leftRect->setParent2D(this);450 413 451 this->leftRect->setWidgetSize(float(overlayWidth), float(this->resY)); 414 452 this->leftRect->setAbsCoor2D(0,0); 415 this->leftRect->setBackgroundTexture(Texture());453 /*this->leftRect->setBackgroundTexture(Texture()); 416 454 this->leftRect->setBackgroundColor(Color(0,0,0.7,0.2)); 417 455 this->leftRect->setForegroundTexture(Texture()); 418 this->leftRect->setForegroundColor(Color(0,0,0,0)); 419 420 this->rightRect->setParent2D(this); 456 this->leftRect->setForegroundColor(Color(0,0,0,0));*/ 457 421 458 this->rightRect->setWidgetSize(float(overlayWidth), float(this->resY)); 422 459 this->rightRect->setAbsCoor2D(this->resX - overlayWidth,0); 423 this->rightRect->setBackgroundTexture(Texture());460 /*this->rightRect->setBackgroundTexture(Texture()); 424 461 this->rightRect->setBackgroundColor(Color(0,0,0.7,0.2)); 425 462 this->rightRect->setForegroundTexture(Texture()); 426 this->rightRect->setForegroundColor(Color(0,0,0,0)); 463 this->rightRect->setForegroundColor(Color(0,0,0,0));*/ 427 464 } 428 465 else … … 431 468 this->bottomRect->setWidgetSize(float(this->resX), float(overlayWidth)); 432 469 this->bottomRect->setAbsCoor2D(0, this->resY - overlayWidth); 470 433 471 this->topRect->setParent2D(this); 434 472 this->topRect->setWidgetSize(float(this->resX), float(overlayWidth)); 435 473 this->topRect->setAbsCoor2D(0, 0); 474 436 475 this->middleRect->setParent2D(this); 437 this->middleRect->setWidgetSize(float(this->resY)/2, float(this->resY)/2); 438 this->middleRect->setAbsCoor2D(float(this->resX - this->resY/2)/2, float(this->resY)/4); 476 //this->middleRect->setWidgetSize(float(this->resY)/2, float(this->resY)/2); 477 this->middleRect->setAbsCoor2D(/*float(this->resX - this->resY/2)/2, float(this->resY)/4*/float(this->resX/2), float(this->resY/2)); 478 479 this->bottomHit->setRelCoor2D(0, this->resY/4); 480 this->topHit->setRelCoor2D(0, -this->resY/4); 481 this->leftHit->setRelCoor2D(-this->resX/4, 0); 482 this->rightHit->setRelCoor2D(this->resX/4, 0); 439 483 } 440 484 -
branches/presentation/src/util/hud.h
r10698 r10716 47 47 void notifyUser(const std::string& message); 48 48 49 inline void setMode(Hud::Playmode playmode) {this->playmode = playmode;};49 void setMode(Hud::Playmode playmode); 50 50 inline Hud::Playmode getMode() {return this->playmode;}; 51 51 … … 93 93 private: 94 94 void updateResolution(); 95 void init(); 95 96 //void createShipValuesBox(); 96 97 … … 119 120 OrxGui::GLGuiWidget* middleRect; 120 121 OrxGui::GLGuiWidget* barSocket; 122 OrxGui::GLGuiImage* topHit; 123 OrxGui::GLGuiImage* bottomHit; 124 OrxGui::GLGuiImage* leftHit; 125 OrxGui::GLGuiImage* rightHit; 121 126 bool overlayActive; 122 127 int overlayPercentage; //the percentage of the screen, the player has got for his movements. should always be a value between 0 and 1;
Note: See TracChangeset
for help on using the changeset viewer.