Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8984 in orxonox.OLD for trunk


Ignore:
Timestamp:
Jul 1, 2006, 4:23:49 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: gui with fading :)

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/gui/gl/glgui_bar.cc

    r8983 r8984  
    7070
    7171    this->_value = value;
    72 
    73     this->_frontRect.setRight(this->getSizeX2D() * (_value -_minimum)/ (_minimum + _maximum));
     72    this->_frontRect.setSize((this->getSizeX2D() - borderLeft() - borderRight()) * (_value -_minimum)/ (_minimum + _maximum)
     73        ,this->getSizeY2D() - borderTop() - borderBottom());
    7474  }
    7575  void GLGuiBar::setMinimum(float minimum)
     
    9797  }
    9898
    99   void GLGuiBar::updateFrontColor()
    100   {
    101     this->font().setDiffuseColor(Color());
    102   }
    103 
    104 
    10599
    106100  /**
     
    112106    GLGuiWidget::draw();
    113107
    114     this->font().select();
    115     glDisable(GL_BLEND);
     108    this->foreground().select();
    116109    this->drawRect(this->_frontRect);
    117110
  • trunk/src/lib/gui/gl/glgui_bar.h

    r8983 r8984  
    4040  protected:
    4141    virtual void resize();
    42     virtual void updateFrontColor();
    4342
    4443  private:
  • trunk/src/world_entities/elements/glgui_energywidget.cc

    r8983 r8984  
    3939    this->_bar.setBackgroundTexture(Texture());
    4040    this->_bar.setBackgroundColor(Color(0,0,0,0));
    41     this->_bar.setForegroundColor(Color(1, 1, 1, 1));
     41    this->_bar.setForegroundColor(Color(.5, .5, .5, 1));
    4242    this->_bar.font().setBlendFunc(GL_SRC_ALPHA, GL_DST_ALPHA);
    4343  }
     
    6868    val.setType(MT_INT);
    6969
     70
    7071    this->_bar.setValue(value);
     72    this->_bar.setForegroundColor(Color(1 - (value / this->_bar.getMaximum()), value / this->_bar.getMaximum(),0,1));
    7173    this->_valueText.setText(val.getString());
    7274  }
  • trunk/src/world_entities/weapons/test_gun.cc

    r8983 r8984  
    120120  this->setStateDuration(WS_DEACTIVATING, .4);
    121121
    122   this->setEnergyMax(10000);
     122  this->setEnergyMax(1000);
    123123  this->increaseEnergy(1000);
    124124  //this->minCharge = 2;
Note: See TracChangeset for help on using the changeset viewer.