Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8582 in orxonox.OLD for branches


Ignore:
Timestamp:
Jun 19, 2006, 12:35:13 PM (18 years ago)
Author:
bensch
Message:

more functionality when loading styles

Location:
branches/gui/src/lib/gui/gl
Files:
2 edited

Legend:

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

    r8575 r8582  
    8383    LoadParam(root, "background-color", this, GLGuiStyle, setBackgroundColorS);
    8484    LoadParam(root, "foreground-color", this, GLGuiStyle, setForegroundColorS);
     85
     86//    LoadParamXML(root, "backmat", this, GLGuiStyle, loadBackgroundMaterial);
     87//    LoadParamXML(root, "frontmat", this, GLGuiStyle, loadForegroundMaterial);
    8588
    8689    LoadParam(root, "feature-position", this, GLGuiStyle, setFeaturePositionS);
     
    323326  }
    324327
     328
    325329  /**
    326330   * @brief sets the Background Texture.
     
    374378      this->setForegroundColor(Color(r,g,b,a));
    375379  }
     380
     381
     382  void GLGuiStyle::loadBackgroundMaterial(const Material& material)
     383  {
     384    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
     385      this->loadForegroundMaterial(material, (OrxGui::State)i);
     386  }
     387
     388  void GLGuiStyle::loadBackgroundMaterial(const Material& material, OrxGui::State state)
     389  {
     390    this->_style[state]._background = material;
     391  }
     392
     393  void GLGuiStyle::loadBackgroundMaterial(const TiXmlElement* element)
     394  {
     395    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
     396      this->_style[i]._background.loadParams(element);
     397  }
     398
     399  void GLGuiStyle::loadBackgroundMaterial(const TiXmlElement* element, OrxGui::State state)
     400  {
     401    this->_style[state]._background.loadParams(element);
     402  }
     403  void GLGuiStyle::loadBackgroundMaterialS(const TiXmlElement* element, const std::string& stateName)
     404  {
     405    OrxGui::State state;
     406    if (getState(stateName, &state))
     407      this->loadBackgroundMaterial(element, state);
     408    else
     409      this->loadBackgroundMaterial(element);
     410  }
     411
     412  void GLGuiStyle::loadForegroundMaterial(const Material& material)
     413  {}
     414  void GLGuiStyle::loadForegroundMaterial(const Material& material, OrxGui::State state)
     415  {}
     416  void GLGuiStyle::loadForegroundMaterial(const TiXmlElement* element, OrxGui::State state)
     417  {}
     418  void GLGuiStyle::loadForegroundMaterialS(const TiXmlElement* element, const std::string& stateName)
     419  {}
    376420
    377421
  • branches/gui/src/lib/gui/gl/glgui_style.h

    r8575 r8582  
    9292    void setForegroundColorS(float r, float g, float b, float a, const std::string& stateName);
    9393
     94    void loadBackgroundMaterial(const Material& material);
     95    void loadBackgroundMaterial(const Material& material, OrxGui::State state);
     96    void loadBackgroundMaterial(const TiXmlElement* element);
     97    void loadBackgroundMaterial(const TiXmlElement* element, OrxGui::State state);
     98    void loadBackgroundMaterialS(const TiXmlElement* element, const std::string& stateName);
     99
     100    void loadForegroundMaterial(const Material& material);
     101    void loadForegroundMaterial(const Material& material, OrxGui::State state);
     102    void loadForegroundMaterial(const TiXmlElement* element, OrxGui::State state);
     103    void loadForegroundMaterialS(const TiXmlElement* element, const std::string& stateName);
    94104
    95105    void setFeaturePosition(FeaturePosition featurePosition);
     
    102112    void setAnimatedStateChanges(bool animated);
    103113
    104     private:
    105       bool getState(const std::string& stateName, OrxGui::State* state);
     114  private:
     115    bool getState(const std::string& stateName, OrxGui::State* state);
    106116
    107117  private:
Note: See TracChangeset for help on using the changeset viewer.