Changeset 10748 in orxonox.OLD for branches/presentation/src/util
- Timestamp:
- Jun 20, 2007, 10:11:59 PM (18 years ago)
- Location:
- branches/presentation/src/util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/presentation/src/util/hud.cc
r10744 r10748 58 58 this->resX = 1; 59 59 this->resY = 1; 60 this->leftHit = NULL; 61 this->rightHit = NULL; 62 this->ifinit = true; 60 63 61 64 this->init(); … … 72 75 delete this->inputLine; 73 76 delete this->notifier; 74 delete this->leftHit;75 delete this->rightHit;77 //delete this->leftHit; 78 //delete this->rightHit; 76 79 77 80 delete this->_radar; … … 133 136 this->leftHit->loadImageFromFile("textures/gui/gui_hitbar.png"); 134 137 this->leftHit->setParent2D(this->middleRect); 135 this->leftHit->shiftDir2D(0.5);138 136 139 137 140 this->rightHit = new OrxGui::GLGuiImage(); … … 438 441 this->leftHit->show(); 439 442 this->rightHit->show(); 443 hitBarCount = 0.33; 444 } 445 446 void Hud::tick(float dt) 447 { 448 449 if (this->playmode == FirstPerson && this->leftHit != NULL) 450 { 451 if (this->ifinit) 452 { 453 this->leftHit->shiftDir2D(3.1416); 454 this->ifinit = false; 455 } 456 if (this->leftHit->isVisible()) 457 hitBarCount -= dt; 458 if (hitBarCount < 0) 459 { 460 hitBarCount = 0; 461 this->leftHit->hide(); 462 this->rightHit->hide(); 463 } 464 } 440 465 } 441 466 … … 502 527 this->leftHit->setRelCoor2D(0, 0); 503 528 this->leftHit->setWidgetSize(this->resX/9, this->resX/3); 504 this->leftHit-> show();529 this->leftHit->hide(); 505 530 this->rightHit->setRelCoor2D(this->resX/3, 0); 506 531 this->rightHit->setWidgetSize(this->resX/9, this->resX/3); … … 509 534 this->barSocket->setWidgetSize(overlayWidth, overlayWidth); 510 535 this->barSocket->setRelCoor2D(this->resX - overlayWidth, 0); 511 this->barSocket-> hide();536 this->barSocket->show(); 512 537 513 538 //this->middleRect->show(); -
branches/presentation/src/util/hud.h
r10744 r10748 52 52 void getHit(); 53 53 54 void tick(float dt); 55 54 56 void setBackGround(); 55 57 void setEnergyWidget(OrxGui::GLGuiWidget* widget); … … 101 103 unsigned int resX; 102 104 unsigned int resY; 105 106 float hitBarCount; 103 107 104 108 Hud::Playmode playmode; … … 115 119 OrxGui::GLGuiRadar* _radar; 116 120 PNode* radarCenterNode; 121 122 bool ifinit; 117 123 118 124 OrxGui::GLGuiWidget* rightRect;
Note: See TracChangeset
for help on using the changeset viewer.