Changeset 8517 in orxonox.OLD for branches/gui/src/util/hud.cc
- Timestamp:
- Jun 16, 2006, 9:16:50 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/util/hud.cc
r8448 r8517 23 23 #include "glgui_widget.h" 24 24 25 #include "glgui_inputline.h" 26 #include "specials/glgui_notifier.h" 27 25 28 /** 26 29 * standard constructor … … 39 42 this->resY = 1; 40 43 44 this->inputLine = new OrxGui::GLGuiInputLine(); 45 this->inputLine->setParent2D(this); 46 this->notifier = new OrxGui::GLGuiNotifier(); 47 this->notifier->setParent2D(this); 48 notifier->setAbsCoor2D(100,100); 49 50 51 41 52 } 42 53 … … 47 58 Hud::~Hud () 48 59 { 60 delete this->inputLine; 61 delete this->notifier; 49 62 // delete what has to be deleted here 50 63 } … … 56 69 } 57 70 71 void Hud::notifyUser(const std::string& message) 72 { 73 this->notifier->pushNotifyMessage(message); 74 } 75 58 76 void Hud::setBackGround() 59 { 60 } 77 {} 61 78 62 79 void Hud::setEnergyWidget(OrxGui::GLGuiWidget* widget) … … 74 91 this->energyWidget->backMaterial().setDiffuseMap("hud_energy_background.png"); 75 92 this->energyWidget->backMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 76 /* this->energyWidget->frontMaterial().setDiffuseMap("hud_energy_bar.png");77 this->energyWidget->frontMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);*/93 /* this->energyWidget->frontMaterial().setDiffuseMap("hud_energy_bar.png"); 94 this->energyWidget->frontMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);*/ 78 95 } 79 96 … … 82 99 83 100 void Hud::setShiledWidget(OrxGui::GLGuiWidget* widget) 84 { 85 } 101 {} 86 102 87 103 void Hud::setArmorWidget(OrxGui::GLGuiWidget* widget) 88 { 89 } 104 {} 90 105 91 106 void Hud::setWeaponManager(WeaponManager* weaponMan) … … 123 138 if (this->weaponManager != NULL) 124 139 for (unsigned int i = 0; i < this->weaponManager->getSlotCount(); i++) 125 {126 Weapon* weapon = this->weaponManager->getWeapon(i);127 if (weapon != NULL)128 140 { 129 weapon->getEnergyWidget()->show(); 130 weapon->getEnergyWidget()->backMaterial().setDiffuse( .8,.2,.11); 131 weapon->getEnergyWidget()->backMaterial().setTransparency(.1); 132 weapon->getEnergyWidget()->setFrontColor(Color( .2,.5,.7,.6)); 133 // weapon->getEnergyWidget()->frontMaterial().setTransparency(.6); 134 this->weaponsWidgets.push_back(weapon->getEnergyWidget()); 141 Weapon* weapon = this->weaponManager->getWeapon(i); 142 if (weapon != NULL) 143 { 144 weapon->getEnergyWidget()->show(); 145 weapon->getEnergyWidget()->backMaterial().setDiffuse( .8,.2,.11); 146 weapon->getEnergyWidget()->backMaterial().setTransparency(.1); 147 weapon->getEnergyWidget()->setFrontColor(Color( .2,.5,.7,.6)); 148 // weapon->getEnergyWidget()->frontMaterial().setTransparency(.6); 149 this->weaponsWidgets.push_back(weapon->getEnergyWidget()); 150 } 135 151 } 136 }137 152 this->updateResolution(); 138 153 } 139 154 140 155 void Hud::addWeaponWidget(OrxGui::GLGuiWidget* widget) 141 { 142 } 156 {} 143 157 144 158 void Hud::removeWeaponWidget(OrxGui::GLGuiWidget* widget) 145 { 146 } 159 {} 147 160 148 161 void Hud::updateResolution() … … 162 175 for (weaponWidget = this->weaponsWidgets.begin(); weaponWidget != this->weaponsWidgets.end(); weaponWidget++, pos+=.03) 163 176 { 164 165 177 (*weaponWidget)->setSize2D(.02*this->resX, .2 *this->resY); 178 (*weaponWidget)->setAbsCoor2D(pos*this->resX, .75*this->resY); 166 179 167 180 } … … 171 184 void Hud::tick(float dt) 172 185 { 173 if (this->resY != State::getResY() || this->resX != State::getResY()) 186 if (this->resY != State::getResY() || this->resX != State::getResX()) 187 { 174 188 this->updateResolution(); 189 } 190 175 191 } 176 192 177 193 void Hud::draw() const 178 194 { 179 // GLGuiWidget::draw();195 // GLGuiWidget::draw(); 180 196 } 181 197
Note: See TracChangeset
for help on using the changeset viewer.