Changeset 10332 in orxonox.OLD for branches/playability/src/util
- Timestamp:
- Jan 24, 2007, 3:23:23 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/util/hud.cc
r10291 r10332 316 316 weapon->getEnergyWidget()->setBackgroundColor(Color(.8,.2,.11, 0.1)); 317 317 weapon->getEnergyWidget()->setFrontColor(Color( .2,.5,.7,.6)); 318 weapon->getEnergyWidget()->setWidgetSize(150,50); 318 319 //weapon->getEnergyWidget()->frontMaterial().setTransparency(.6); 319 320 this->weaponsWidgetsSec.push_back(dynamic_cast<OrxGui::GLGuiEnergyWidgetVertical*> (weapon->getEnergyWidget())); … … 341 342 342 343 int overlayWidth = this->resX * (overlayPercentage)/(200); 344 if (overlayWidth < 100) 345 overlayWidth = 100; 346 343 347 this->rightRect->hide(); 344 348 this->leftRect->hide(); … … 406 410 407 411 std::list<OrxGui::GLGuiEnergyWidgetVertical*>::iterator weaponWidget; 408 Vector2D pos = Vector2D(overlayWidth + this->rightRect->getAbsCoor2D().x, 0.5*this->resY);412 Vector2D pos = Vector2D(overlayWidth, 0.4*this->resY); 409 413 //PRINTF(0)("Cur Pos: %f,%f\n",pos.x,pos.y); 410 414 // out of reasons i can't get behind, this version is segfaulting when calling getSizeX2D or getSizeY2D. the other … … 413 417 for (weaponWidget = this->weaponsWidgetsPrim.begin(); weaponWidget != this->weaponsWidgetsPrim.end(); weaponWidget++) 414 418 { 415 if (pos.x < overlayWidth*0.2) 416 { 417 pos.x = overlayWidth + this->rightRect->getAbsCoor2D().x; 419 float ySize = (*weaponWidget)->getSizeY2D(); 420 if (pos.x < ySize) 421 { 422 pos.x = overlayWidth; 418 423 pos.y += (*weaponWidget)->getSizeX2D(); 419 424 } 420 pos.x -= (*weaponWidget)->getSizeY2D();421 (*weaponWidget)->setAbsCoor2D(pos.x , pos.y);425 pos.x -= ySize; 426 (*weaponWidget)->setAbsCoor2D(pos.x + this->rightRect->getAbsCoor2D().x, pos.y); 422 427 //(*weaponWidget)->setAbsCoor2D(0,100); 423 428 (*weaponWidget)->show(); … … 426 431 427 432 pos.y += 160; 428 pos.x = overlayWidth + this->rightRect->getAbsCoor2D().x;433 pos.x = 0; //overlayWidth + this->rightRect->getAbsCoor2D().x; 429 434 for (weaponWidget = this->weaponsWidgetsSec.begin(); weaponWidget != this->weaponsWidgetsSec.end(); weaponWidget++) 430 435 { 431 if (pos.x < overlayWidth*0.2) 432 { 433 pos.x = overlayWidth + this->rightRect->getAbsCoor2D().x; 436 float ySize = (*weaponWidget)->getSizeY2D(); 437 if (pos.x < ySize) 438 { 439 pos.x = overlayWidth; 434 440 pos.y += (*weaponWidget)->getSizeX2D(); 435 441 } 436 pos.x -= (*weaponWidget)->getSizeY2D(); 437 (*weaponWidget)->setAbsCoor2D(pos.x, pos.y); 442 pos.x -= ySize; 443 PRINTF(0)("secweaponwidget y-size: %f/n", (*weaponWidget)->getSizeY2D()); 444 (*weaponWidget)->setAbsCoor2D(pos.x + this->rightRect->getAbsCoor2D().x, pos.y); 438 445 (*weaponWidget)->show(); 439 446 //printf("update thing %s::%s\n", (*weaponWidget)->getClassCName(), (*weaponWidget)->getName());
Note: See TracChangeset
for help on using the changeset viewer.