Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8976 in orxonox.OLD for trunk/src/util/hud.cc


Ignore:
Timestamp:
Jul 1, 2006, 1:05:38 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: the hud displays Energy and WeaponEnergy

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/util/hud.cc

    r8975 r8976  
    1919
    2020#include "state.h"
     21#include "debug.h"
    2122
    2223#include "world_entities/weapons/weapon_manager.h"
     
    121122
    122123  this->updateWeaponManager();
    123   this->updateResolution();
     124//  this->updateResolution();
    124125}
    125126
     
    141142      if (weapon != NULL)
    142143      {
     144        //PRINTF(0)("WEAPON %s::%s in Slots\n", weapon->getClassName(), weapon->getName());
    143145        weapon->getEnergyWidget()->show();
    144146        weapon->getEnergyWidget()->setBackgroundColor(Color(.8,.2,.11, 0.1));
     
    161163  this->resX = State::getResX();
    162164  this->resY = State::getResY();
     165
     166  this->setSize2D(.2 * this->resX, this->resY);
     167
    163168  if (this->energyWidget != NULL)
    164169  {
     
    167172  }
    168173
    169   this->setSize2D(.2 * this->resX, this->resY);
    170174
    171175  std::list<OrxGui::GLGuiWidget*>::iterator weaponWidget;
    172176  float pos = .3;
    173   for (weaponWidget = this->weaponsWidgets.begin(); weaponWidget != this->weaponsWidgets.end(); weaponWidget++, pos+=.03)
    174   {
    175     (*weaponWidget)->setWidgetSize(.02*this->resX, .2 *this->resY);
    176     (*weaponWidget)->setAbsCoor2D(pos*this->resX, .75*this->resY);
    177 
     177  for (weaponWidget = this->weaponsWidgets.begin(); weaponWidget != this->weaponsWidgets.end(); weaponWidget++, pos+=.3)
     178  {
     179    (*weaponWidget)->setAbsCoor2D(pos*this->resX, .9*this->resY);
     180    (*weaponWidget)->setWidgetSize(.02*this->resX, .1 *this->resY);
     181    (*weaponWidget)->show();
     182    //printf("update thing %s::%s\n", (*weaponWidget)->getClassName(), (*weaponWidget)->getName());
    178183  }
    179184}
Note: See TracChangeset for help on using the changeset viewer.