Index: /branches/gui/src/lib/gui/gl/glgui_checkbutton.cc
===================================================================
--- /branches/gui/src/lib/gui/gl/glgui_checkbutton.cc	(revision 8604)
+++ /branches/gui/src/lib/gui/gl/glgui_checkbutton.cc	(revision 8605)
@@ -96,5 +96,4 @@
 //     this->frontMaterial().select();
 //     this->drawRect(this->frontRect());
-
     if (this->bActive)
     {
Index: /branches/gui/src/lib/gui/gl/glgui_cursor.cc
===================================================================
--- /branches/gui/src/lib/gui/gl/glgui_cursor.cc	(revision 8604)
+++ /branches/gui/src/lib/gui/gl/glgui_cursor.cc	(revision 8605)
@@ -57,7 +57,6 @@
     this->setClassID(CL_GLGUI_CURSOR, "GLGuiCursor");
 
-    this->background().setDiffuseColor(Color(1.0,0.0,0.0, 1.0));
-    this->background().setDiffuseMap("cursor.png");
-    this->background().setBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+    this->setBackgroundColor(Color(1.0,0.0,0.0, 1.0));
+    this->setBackgroundTexture("cursor.png");
     this->setSize2D(50, 50);
     this->setAbsCoor2D(100, 100);
@@ -98,5 +97,7 @@
         this->color -= 360.0;
       Vector color =  Color::HSVtoRGB(Vector(this->color, 1.0, 1.0));
-      this->background().setDiffuse(color.x, color.y, color.z);
+      //this->setBackgroundColor(color.x, color.y, color.z);
+      /// FIXME
+
     }
     //if (this->movement != Vector2D())
Index: /branches/gui/src/lib/gui/gl/glgui_widget.cc
===================================================================
--- /branches/gui/src/lib/gui/gl/glgui_widget.cc	(revision 8604)
+++ /branches/gui/src/lib/gui/gl/glgui_widget.cc	(revision 8605)
@@ -14,5 +14,5 @@
 */
 
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_GUI
+#define DEBUG_SPECIAL_MODULE 4//DEBUG_MODULE_GUI
 
 #include "glgui_widget.h"
@@ -41,4 +41,31 @@
 
   /**
+   * @brief loads Parameters for a Style from XML
+   * @param root the XML-Element to load from.
+   */
+  void GLGuiWidget::loadParams(const TiXmlElement* root)
+  {
+
+    /// STYLE
+    LoadParam(root, "border-left", this, GLGuiWidget, setBorderLeft);
+    LoadParam(root, "border-right", this, GLGuiWidget, setBorderRight);
+    LoadParam(root, "border-top", this, GLGuiWidget, setBorderTop);
+    LoadParam(root, "border-bottom", this, GLGuiWidget, setBorderBottom);
+
+    LoadParam(root, "text-size", this, GLGuiWidget, setTextSize);
+    LoadParam(root, "background-color", this, GLGuiWidget, setBackgroundColorS);
+    LoadParam(root, "foreground-color", this, GLGuiWidget, setForegroundColorS);
+
+    //    LoadParamXML(root, "backmat", this, GLGuiWidget, loadBackgroundMaterial);
+    //    LoadParamXML(root, "frontmat", this, GLGuiWidget, loadForegroundMaterial);
+
+    LoadParam(root, "feature-position", this, GLGuiWidget, setFeaturePositionS);
+    LoadParam(root, "Font", this, GLGuiWidget, setFont);
+
+    LoadParam(root, "animated-state-changes", this, GLGuiWidget, setAnimatedStateChanges);
+  }
+
+
+  /**
    * @brief standard deconstructor
    */
@@ -47,7 +74,4 @@
     if (this == GLGuiWidget::_focused)
       GLGuiWidget::_focused = NULL;
-
-    if (this->_toFrontColor)
-      delete this->_toFrontColor;
   }
 
@@ -69,5 +93,4 @@
     this->_pushed = false;
     this->_state = OrxGui::Normal;
-    this->_toFrontColor = NULL;
 
 
@@ -75,9 +98,14 @@
     this->resetStyle();
 
-    this->_animationCycle = -1.0;
+    this->_animating = false;
+    this->_animationCycle = 0.0;
     this->_animationDuration = 1.0;
 
 
     this->setBackgroundColor(Color(0, 0, 0, 1));
+    this->_style[0]._background.setBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+    this->_style[1]._background.setBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+    this->_style[2]._background.setBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+    this->_style[3]._background.setBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
 
     this->setForegroundColor(Color(1, 0, 0, 1), OrxGui::Normal);
@@ -136,5 +164,5 @@
   void GLGuiWidget::setFrontColor(const Color& frontColor, bool instantaniously)
   {
-    if (instantaniously)
+/*    if (instantaniously)
     {
       this->setForegroundColor(frontColor);
@@ -150,5 +178,5 @@
       *this->_toFrontColor = frontColor;
     //this->_frontColor = frontColor;
-    //this->updateFrontColor();
+    //this->updateFrontColor();*/
   };
 
@@ -265,32 +293,7 @@
     this->setFont(NULL);
 
-    this->setAnimated(true);
     this->setAnimatedStateChanges(true);
   }
 
-  /**
-   * @brief loads Parameters for a Style from XML
-   * @param root the XML-Element to load from.
-   */
-  void GLGuiWidget::loadParams(const TiXmlElement* root)
-  {
-    LoadParam(root, "border-left", this, GLGuiWidget, setBorderLeft);
-    LoadParam(root, "border-right", this, GLGuiWidget, setBorderRight);
-    LoadParam(root, "border-top", this, GLGuiWidget, setBorderTop);
-    LoadParam(root, "border-bottom", this, GLGuiWidget, setBorderBottom);
-
-    LoadParam(root, "text-size", this, GLGuiWidget, setTextSize);
-    LoadParam(root, "background-color", this, GLGuiWidget, setBackgroundColorS);
-    LoadParam(root, "foreground-color", this, GLGuiWidget, setForegroundColorS);
-
-    //    LoadParamXML(root, "backmat", this, GLGuiWidget, loadBackgroundMaterial);
-    //    LoadParamXML(root, "frontmat", this, GLGuiWidget, loadForegroundMaterial);
-
-    LoadParam(root, "feature-position", this, GLGuiWidget, setFeaturePositionS);
-    LoadParam(root, "Font", this, GLGuiWidget, setFont);
-
-    LoadParam(root, "animated", this, GLGuiWidget, setAnimated);
-    LoadParam(root, "animated-state-changes", this, GLGuiWidget, setAnimatedStateChanges);
-  }
 
   /**
@@ -674,13 +677,4 @@
 
   /**
-   * @brief if Animation should be turned on.
-   * @param animated true if on, false otherwise.
-   */
-  void GLGuiWidget::setAnimated(bool animated)
-  {
-    this->_animated = animated;
-  }
-
-  /**
    * @brief sets the AnimatedState.
    * @param animated: it states-changes should animate true, otherwise false.
@@ -694,7 +688,9 @@
   void GLGuiWidget::switchState(OrxGui::State state)
   {
-    this->_currentStyle = this->_style[state];
+    //this->_currentStyle = this->_style[state];
     this->_state = state;
-    printf("Switching to state %s\n", OrxGui::StateString[state].c_str());
+    PRINTF(3)("Switching to state %s\n", OrxGui::StateString[state].c_str());
+
+    this->animateBack();
   }
 
@@ -716,16 +712,27 @@
   }
 
+  void GLGuiWidget::animateBack()
+  {
+    this->_animating = true;
+    this->_animationCycle = 0.0f;
+  }
+
 
   void GLGuiWidget::tick(float dt)
   {
-    if (this->_toFrontColor)
+    if (this->_animating)
     {
-      this->foregroundColor(_state).slerp(*_toFrontColor, dt*3.0);
+      this->foregroundColor();
+
+      _animationCycle += dt / _animationDuration;
+      if (_animationCycle >= 1.0)
+      {
+        _currentStyle._foreground.diffuseColor() = this->foregroundColor(_state);
+        _animating = false;
+      }
+      else
+        _currentStyle._foreground.diffuseColor().slerp(this->foregroundColor(_state), _animationCycle);
+
       this->updateFrontColor();
-      if (this->foregroundColor(_state).dist(*_toFrontColor) < .1)
-      {
-        delete _toFrontColor;
-        _toFrontColor = NULL;
-      }
     }
   }
@@ -779,6 +786,4 @@
     /// TODO    PRINT(0)("");    Font*               _font;                 //!< The Font used in the current Widget.
 
-    if (_animated)
-      PRINT(0)("- Animated ");
     if (_animatedStateChanges)
       PRINT(0)("- AnimatedStateChanges");
@@ -786,4 +791,8 @@
 
     /*
+    if (_animating)
+      PRINT(0)("- Animated ");
+
+    //
     float               _animationCycle;
     float               _animationDuration;
Index: /branches/gui/src/lib/gui/gl/glgui_widget.h
===================================================================
--- /branches/gui/src/lib/gui/gl/glgui_widget.h	(revision 8604)
+++ /branches/gui/src/lib/gui/gl/glgui_widget.h	(revision 8605)
@@ -79,5 +79,5 @@
     void setWidgetSize(float x, float y);
 
-
+    void animateBack();
 
     /// STYLE
@@ -114,5 +114,5 @@
     inline const Font* const font() const { return _font; }
     /** @returns true if the Element is Animated */
-    inline bool animated() const { return _animated; }
+    inline bool animating() const { return _animating; }
     /** @returns true if State-Changes are animated */
     inline bool animatedStateChanges() const { return _animatedStateChanges; }
@@ -182,9 +182,4 @@
     void setForegroundColorS(float r, float g, float b, float a, const std::string& stateName);
 
-    inline Color& foregroundColor(OrxGui::State state= GLGUI_DEFAULT_STYLE) { return _style[state]._foreground.diffuseColor(); }
-    inline Color& backgroundColor(OrxGui::State state= GLGUI_DEFAULT_STYLE) { return _style[state]._background.diffuseColor(); }
-    inline Material& background(OrxGui::State state = GLGUI_DEFAULT_STYLE) { return _style[state]._background; }
-    inline Material& foreground(OrxGui::State state = GLGUI_DEFAULT_STYLE) { return _style[state]._foreground; }
-
     void loadBackgroundMaterial(const Material& material);
     void loadBackgroundMaterial(const Material& material, OrxGui::State state);
@@ -204,5 +199,4 @@
     void setFont(const std::string& fontName);
 
-    void setAnimated(bool animated);
     void setAnimatedStateChanges(bool animated);
     void switchState(OrxGui::State state);
@@ -261,12 +255,9 @@
 
 
-
+    /// WIDGET
     GLGuiWidget*                   _parent;           //!< The parent of this Widget.
 
     /// LOOKS
     Rect2D                         _backRect;
-
-    Color*                         _toFrontColor;
-
     Vector2D                       _minSize;
 
@@ -306,7 +297,7 @@
 
     /// ANIMATION STUFF:
-    bool                _animated;             //!< If the Widget is animated (Texture might be an AnimatedTexture.)
     bool                _animatedStateChanges; //!< If the Transitions between States are Animated automatically.
 
+    bool                _animating;            //!< If the Widget is animated at the moment (Texture might be an AnimatedTexture.)
     float               _animationCycle;
     float               _animationDuration;
Index: /branches/gui/src/util/hud.cc
===================================================================
--- /branches/gui/src/util/hud.cc	(revision 8604)
+++ /branches/gui/src/util/hud.cc	(revision 8605)
@@ -89,6 +89,5 @@
   {
     this->energyWidget->show();
-    this->energyWidget->background().setDiffuseMap("hud_energy_background.png");
-    this->energyWidget->background().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+    this->energyWidget->setBackgroundTexture( "hud_energy_background.png");
     /*    this->energyWidget->frontMaterial().setDiffuseMap("hud_energy_bar.png");
         this->energyWidget->frontMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);*/
@@ -143,6 +142,5 @@
       {
         weapon->getEnergyWidget()->show();
-        weapon->getEnergyWidget()->background().setDiffuse( .8,.2,.11);
-        weapon->getEnergyWidget()->background().setTransparency(.1);
+        weapon->getEnergyWidget()->setBackgroundColor(Color(.8,.2,.11, 0.1));
         weapon->getEnergyWidget()->setFrontColor(Color( .2,.5,.7,.6));
         //      weapon->getEnergyWidget()->frontMaterial().setTransparency(.6);
