Changeset 10748 in orxonox.OLD for branches/presentation/src/util/hud.cc
- Timestamp:
- Jun 20, 2007, 10:11:59 PM (17 years ago)
- File:
-
- 1 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();
Note: See TracChangeset
for help on using the changeset viewer.