Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8977 in orxonox.OLD for trunk/src


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

trunk: gui displayes nicely

Location:
trunk/src/world_entities
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/elements/glgui_energywidget.cc

    r8976 r8977  
    2828    //   this->setClassID(CL_PROTO_ID, "GLGuiEnergyWidget");
    2929
     30    this->pack(&this->name);
    3031    this->pack(&this->text);
    3132    this->pack(&this->bar);
     
    4243
    4344
     45  void GLGuiEnergyWidget::setDisplayedName(const std::string& name)
     46  {
     47    this->name.setText(name);
     48  }
    4449
    4550  void GLGuiEnergyWidget::setMaximum(float max)
     
    6065  void GLGuiEnergyWidget::showing()
    6166  {
     67    this->name.show();
    6268    this->text.show();
    6369    this->bar.show();
     
    6672  void GLGuiEnergyWidget::hiding()
    6773  {
     74    this->name.hide();
    6875    this->text.hide();
    6976    this->bar.hide();
    7077  }
    71 
    72 
    73 
    7478}
  • trunk/src/world_entities/elements/glgui_energywidget.h

    r8975 r8977  
    2222    virtual ~GLGuiEnergyWidget();
    2323
     24    void setDisplayedName(const std::string& name);
    2425    void setMaximum(float max);
    2526    void setValue(float value);
     
    3132
    3233  private:
     34    GLGuiText               name;
    3335    GLGuiBar                bar;
    3436    GLGuiText               text;
  • trunk/src/world_entities/weapons/weapon.cc

    r8976 r8977  
    312312  if (this->energyWidget == NULL)
    313313  {
    314     this->energyWidget = new OrxGui::GLGuiEnergyWidget;
     314    this->energyWidget = new OrxGui::GLGuiEnergyWidget();
     315    this->energyWidget->setDisplayedName(this->getClassName());
    315316    this->energyWidget->setSize2D( 20, 100);
    316317    this->energyWidget->setMaximum(this->getEnergyMax());
  • trunk/src/world_entities/world_entity.cc

    r8974 r8977  
    682682  {
    683683    this->healthWidget = new OrxGui::GLGuiEnergyWidget();
     684    this->healthWidget->setDisplayedName(std::string(this->getClassName()) + " Energy:");
    684685    this->healthWidget->setSize2D(30,400);
    685686    this->healthWidget->setAbsCoor2D(10,100);
Note: See TracChangeset for help on using the changeset viewer.