Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8611 in orxonox.OLD


Ignore:
Timestamp:
Jun 20, 2006, 10:46:02 AM (18 years ago)
Author:
bensch
Message:

background Color animatable

File:
1 edited

Legend:

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

    r8610 r8611  
    104104
    105105    this->setBackgroundColor(Color(.51, .3, .3, .5));
     106    this->setBackgroundColor(Color(.3, .5, .3, 1), OrxGui::Selected);
    106107    this->_style[0]._background.setBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    107108    this->_style[1]._background.setBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
     
    711712
    712713
    713   /**
    714    * @param stateName the Name of a State.
    715    * @param state the found State is returned here if found.
    716    * @returns true if String is found, false otherwise.
    717    */
    718   bool GLGuiWidget::getState(const std::string& stateName, OrxGui::State* state)
    719   {
    720     for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
    721       if (stateName == OrxGui::StateString[i])
    722       {
    723         *state = (OrxGui::State)i;
    724         return true;
    725       }
    726     return false;
    727   }
    728 
    729714  void GLGuiWidget::animateBack()
    730715  {
     
    744729      {
    745730        _currentStyle._foreground.diffuseColor() = this->foregroundColor(_state);
     731        _currentStyle._background.diffuseColor() = this->backgroundColor(_state);
    746732        _animating = false;
    747733      }
    748734      else
     735      {
    749736        _currentStyle._foreground.diffuseColor().slerp(this->foregroundColor(_state), _animationCycle);
    750 
     737        _currentStyle._background.diffuseColor().slerp(this->backgroundColor(_state), _animationCycle);
     738      }
    751739      this->updateFrontColor();
    752740    }
     
    764752  }
    765753
     754
     755  /**
     756   * @param stateName the Name of a State.
     757   * @param state the found State is returned here if found.
     758   * @returns true if String is found, false otherwise.
     759   */
     760  bool GLGuiWidget::getState(const std::string& stateName, OrxGui::State* state)
     761  {
     762    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
     763      if (stateName == OrxGui::StateString[i])
     764    {
     765      *state = (OrxGui::State)i;
     766      return true;
     767    }
     768    return false;
     769  }
     770
     771  /**
     772   * @brief print out some nice debug output about the Widget.
     773   */
    766774  void GLGuiWidget::debug() const
    767775  {
     
    791799      PRINT(0)("  Borders: Left: %0.2f, Right: %0.2f, Top: %0.2f, Bottom %0.2f\n",
    792800               _style[i]._borderLeft, _style[i]._borderRight, _style[i]._borderTop, _style[i]._borderBottom);
    793       PRINT(0)("  TextSize %0.2f", _style[i]._textSize);
    794       PRINT(0)(" - BackgroundColor"); _style[i]._background.diffuseColor().debug();
    795       PRINT(0)(" - ForegroundColor"); _style[i]._foreground.diffuseColor().debug();
     801      PRINT(0)("  TextSize %0.2f\n", _style[i]._textSize);
     802      PRINT(0)("  BackgroundColor: "); _style[i]._background.diffuseColor().debug();
     803      PRINT(0)("  ForegroundColor: "); _style[i]._foreground.diffuseColor().debug();
    796804      PRINT(0)("\n");
    797805    }
Note: See TracChangeset for help on using the changeset viewer.