Changeset 10143 for code/branches
- Timestamp:
- Nov 26, 2014, 5:18:44 PM (10 years ago)
- Location:
- code/branches/hudHS14/src/modules/overlays/hud
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/hudHS14/src/modules/overlays/hud/HUDEnemyHealthBar.cc
r10110 r10143 60 60 61 61 62 63 62 /* 64 63 //-------------------------------------------------------------------------- 65 64 //first try to place a healthbar under the enemy ship 66 65 //getting all the parameters (direction, position, angle) to place the health bar on the screen … … 96 95 97 96 this->setTextOffset(screenCoordinates); 98 99 100 101 102 103 97 } 104 105 98 //-------------------------------------------------------------------------- 106 99 */ 100 107 101 108 102 … … 121 115 target = target->getParent(); 122 116 pawn = orxonox_cast<Pawn*>(target); 123 124 125 126 /*Vector3 tempPosition = target->getWorldPosition();127 Vector2 tempPos2D = Vector2(tempPosition.x, tempPosition.y);128 this->pickPoint_(tempPos2D);129 this->position_(tempPos2D);*/130 117 131 118 -
code/branches/hudHS14/src/modules/overlays/hud/HUDNavigation.cc
r10122 r10143 369 369 370 370 371 371 372 // Change material only if outOfView changed 372 373 if (it->second.wasOutOfView_) … … 377 378 it->second.target_->setDimensions(this->aimMarkerSize_ * this->getActualSize().x, this->aimMarkerSize_ * this->getActualSize().y); 378 379 379 // manipulation bzw versuch !!! Jonas380 // 380 381 it->second.health_->setMaterialName(TextureGenerator::getMaterialName("bar2.png", it->first->getRadarObjectColour())); 381 it->second.health_->setDimensions(this->healthMarkerSize_ * this->getActualSize().x, this->healthMarkerSize_ * this->getActualSize().y); 382 382 it->second.health_->setDimensions(this->healthMarkerSize_ * this->getActualSize().x , this->healthMarkerSize_ * this->getActualSize().y); 383 383 it->second.wasOutOfView_ = false; 384 384 } 385 385 386 386 387 //i need to find the place where the amount of health is saved!!! 388 //this->selectedTarget_->getWorldEntity()-> 389 390 391 // Position health (versuch !!!!) 387 //calculate the health of the actual selected radarViewable (while (0) is no health left, (1) is the initial health) 388 389 Pawn* pawnPtr = (Pawn*) (it->first->getWorldEntity()); 390 float health = pawnPtr->getHealth(); 391 float initHealth = pawnPtr->getMaxHealth(); 392 float relativHealthScale = health/initHealth; 393 394 395 // Position and Dimensions (amount) health 392 396 it->second.health_->setUV(0.0f, 0.0f, 1.0f, 1.0f); 393 it->second.health_->setLeft((pos.x + 1.0f - it->second.panel_->getWidth()) * 0.5f); 394 it->second.health_->setTop((-pos.y + 1.0f - it->second.panel_->getHeight()) * 0.5f); 397 it->second.health_->setLeft((pos.x + 0.975f - it->second.panel_->getWidth()) * 0.5f); 398 it->second.health_->setTop((-pos.y + 1.025f - it->second.panel_->getHeight()) * 0.5f); 399 it->second.health_->setDimensions(this->healthMarkerSize_ * this->getActualSize().x * relativHealthScale, this->healthMarkerSize_ * this->getActualSize().y); 400 orxout() << relativHealthScale << endl; 395 401 396 402
Note: See TracChangeset
for help on using the changeset viewer.