- Timestamp:
- Jul 1, 2006, 6:09:30 PM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/gui/gl/glgui_widget.cc
r8989 r8990 651 651 else 652 652 this->setForegroundColor(Color(r,g,b,a)); 653 } 654 655 656 /** 657 * @brief sets the Foreground Texture for all States. 658 * @param texture the Texture. 659 */ 660 void GLGuiWidget::setForegroundTexture(const Texture& texture) 661 { 662 for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i) 663 setForegroundTexture(texture, (OrxGui::State)i); 664 } 665 666 /** 667 * @brief sets the Foreground Texture to all States. 668 * @param textureName the Texture's fileName. 669 */ 670 void GLGuiWidget::setForegroundTexture(const std::string& textureName) 671 { 672 for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i) 673 _style[i]._foreground.setDiffuseMap(textureName); 674 this->_currentStyle._foreground.setDiffuseMap(textureName); 675 } 676 677 /** 678 * @brief sets the Foreground Texture. 679 * @param texture the Texture. 680 * @param state the State to setup. 681 */ 682 void GLGuiWidget::setForegroundTexture(const Texture& texture, OrxGui::State state) 683 { 684 _style[state]._background.setDiffuseMap(texture); 685 if (state == _state) 686 _currentStyle._background.setDiffuseMap(texture); 687 } 688 689 690 691 /** 692 * @brief sets the Foreground Texture. 693 * @param texture the Texture. 694 * @param stateName the State to setup. 695 */ 696 void GLGuiWidget::setForegroundTexture(const std::string& textureName, const std::string& stateName) 697 { 698 OrxGui::State state; 699 if (getState(stateName, &state)) 700 ; /// FIXME this->setForegroundTexture(textureName, state); 701 else 702 ; /// this->setForegroundTexture(textureName); 653 703 } 654 704 -
trunk/src/lib/gui/gl/glgui_widget.h
r8983 r8990 192 192 void setForegroundColorS(float r, float g, float b, float a, const std::string& stateName); 193 193 194 void setForegroundTexture(const Texture& texture); 195 void setForegroundTexture(const std::string& textureName); 196 void setForegroundTexture(const Texture& texture, OrxGui::State state); 197 void setForegroundTexture(const std::string& textureName, const std::string& stateName); 198 194 199 void loadBackgroundMaterial(const Material& material); 195 200 void loadBackgroundMaterial(const Material& material, OrxGui::State state); -
trunk/src/util/hud.cc
r8989 r8990 49 49 notifier->setAbsCoor2D(100,100); 50 50 51 this->subscribeEvent(ES_ALL, EV_VIDEO_RESIZE); 51 52 52 53 … … 192 193 } 193 194 194 195 void Hud::tick(float dt) 196 { 197 if (this->resY != State::getResY() || this->resX != State::getResX()) 198 { 195 void Hud::draw() const 196 { 197 // GLGuiWidget::draw(); 198 } 199 200 201 void Hud::process(const Event &event) 202 { 203 if (event.type == EV_VIDEO_RESIZE) 199 204 this->updateResolution(); 200 } 201 202 } 203 204 void Hud::draw() const 205 { 206 // GLGuiWidget::draw(); 207 } 208 209 205 } 206 207 -
trunk/src/util/hud.h
r8972 r8990 8 8 9 9 #include "element_2d.h" 10 #include "event_listener.h" 10 11 // FORWARD DECLARATION 11 12 class TiXmlElement; … … 20 21 21 22 //! A class that renders a HUD (Heads Up Display for User Information). 22 class Hud : public Element2D 23 class Hud : public Element2D, public EventListener 23 24 { 24 25 … … 44 45 void updateWeaponManager(); 45 46 46 void tick(float dt);47 47 void draw() const; 48 virtual void process(const Event &event); 49 48 50 49 51 private: -
trunk/src/world_entities/elements/glgui_energywidget.cc
r8988 r8990 39 39 this->_bar.setBackgroundTexture(Texture()); 40 40 this->_bar.setBackgroundColor(Color(0,0,0,0)); 41 this->_bar.setForegroundTexture("maps/gui_element_background_faded.png"); 41 42 this->_bar.setForegroundColor(Color(.5, .5, .5, 1)); 42 43 }
Note: See TracChangeset
for help on using the changeset viewer.