Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8435 in orxonox.OLD for branches/gui/src/lib/gui/gl/glgui_widget.cc


Ignore:
Timestamp:
Jun 15, 2006, 1:16:13 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: fade to colors
now the gui can be looked at :)
at least a bit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/src/lib/gui/gl/glgui_widget.cc

    r8425 r8435  
    4545    if (this == GLGuiWidget::_focused)
    4646      GLGuiWidget::_focused = NULL;
     47
     48    if (this->_toFrontColor)
     49      delete this->_toFrontColor;
    4750  }
    4851
     
    6972    this->_backMat.setDiffuseMap("gui_element_background.png");
    7073    this->_frontColor.setColor(1.0, 0.0, 0.0);
     74    _toFrontColor = NULL;
     75
    7176
    7277    this->_borderLeft = 15.0;
     
    116121  }
    117122
     123  void GLGuiWidget::setFrontColor(const Color& frontColor)
     124  {
     125    if (!this->_toFrontColor)
     126      this->_toFrontColor = new Color(frontColor);
     127    else
     128      *this->_toFrontColor = frontColor;
     129    //this->_frontColor = frontColor;
     130    //this->updateFrontColor();
     131  };
     132
    118133
    119134  void GLGuiWidget::setBorderSize(float borderSize)
     
    243258  }
    244259
     260  void GLGuiWidget::tick(float dt)
     261  {
     262    if (this->_toFrontColor)
     263    {
     264      this->_frontColor.slerp(*_toFrontColor, dt*3.0);
     265      this->updateFrontColor();
     266      if (this->_frontColor.dist(*_toFrontColor) < .1)
     267      {
     268        delete _toFrontColor;
     269        _toFrontColor = NULL;
     270      }
     271    }
     272  }
     273
    245274
    246275  /**
Note: See TracChangeset for help on using the changeset viewer.