- Timestamp:
- Jul 1, 2006, 11:47:08 AM (18 years ago)
- Location:
- trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/gui/gl/glgui_bar.cc
r8972 r8974 68 68 void GLGuiBar::draw() const 69 69 { 70 printf("BAR\n");71 70 this->beginDraw(); 72 71 GLGuiWidget::draw(); -
trunk/src/world_entities/elements/glgui_energywidget.cc
r8973 r8974 28 28 // this->setClassID(CL_PROTO_ID, "GLGuiEnergyWidget"); 29 29 30 this-> text.setParent2D(this);31 this-> bar.setParent2D(this);30 this->pack(&this->text); 31 this->pack(&this->bar); 32 32 } 33 33 … … 40 40 // delete what has to be deleted here 41 41 } 42 43 44 void GLGuiEnergyWidget::setMaximum(float max) 45 { 46 this->bar.setMaximum(max); 47 } 48 49 void GLGuiEnergyWidget::setValue(float value) 50 { 51 MultiType val = value; 52 53 this->bar.setValue(value); 54 this->text.setText(val.getString()); 55 } 56 57 58 42 59 } -
trunk/src/world_entities/elements/glgui_energywidget.h
r8973 r8974 7 7 #define _GLGUI_ENERGY_WIDGET_H 8 8 9 #include "glgui_ widget.h"9 #include "glgui_box.h" 10 10 #include "glgui_bar.h" 11 11 #include "glgui_text.h" … … 15 15 16 16 //! A class for ... 17 class GLGuiEnergyWidget : public GLGui Widget17 class GLGuiEnergyWidget : public GLGuiBox 18 18 { 19 19 … … 22 22 virtual ~GLGuiEnergyWidget(); 23 23 24 void setMaximum(float max); 25 void setValue(float value); 26 24 27 protected: 25 virtual void resize();28 //virtual void resize(); 26 29 27 30 private: -
trunk/src/world_entities/world_entity.cc
r8972 r8974 31 31 #include "obb_tree.h" 32 32 33 #include " glgui_bar.h"33 #include "elements/glgui_energywidget.h" 34 34 35 35 #include "state.h" … … 681 681 if (this->healthWidget == NULL) 682 682 { 683 this->healthWidget = new OrxGui::GLGui Bar();683 this->healthWidget = new OrxGui::GLGuiEnergyWidget(); 684 684 this->healthWidget->setSize2D(30,400); 685 685 this->healthWidget->setAbsCoor2D(10,100); -
trunk/src/world_entities/world_entity.h
r8894 r8974 24 24 // FORWARD DECLARATION 25 25 namespace OrxSound { class SoundBuffer; class SoundSource; } 26 namespace OrxGui { class GLGuiWidget; class GLGuiBar; };26 namespace OrxGui { class GLGuiWidget; class GLGuiBar; class GLGuiEnergyWidget; }; 27 27 28 28 class BVTree; … … 167 167 float health; //!< The Energy of this Entity, if the Entity has any energy at all. 168 168 float healthMax; //!< The Maximal energy this entity can take. 169 OrxGui::GLGui Bar* healthWidget;//!< The Slider (if wanted).169 OrxGui::GLGuiEnergyWidget* healthWidget; //!< The Slider (if wanted). 170 170 171 171 std::vector<Model*> models; //!< The model that should be loaded for this entity.
Note: See TracChangeset
for help on using the changeset viewer.