Index: /trunk/src/lib/gui/gl/glgui_bar.cc
===================================================================
--- /trunk/src/lib/gui/gl/glgui_bar.cc	(revision 8982)
+++ /trunk/src/lib/gui/gl/glgui_bar.cc	(revision 8983)
@@ -18,4 +18,5 @@
 #include "glgui_bar.h"
 
+#include "debug.h"
 
 namespace OrxGui
@@ -36,6 +37,5 @@
    */
   GLGuiBar::~GLGuiBar()
-  {
-  }
+  {}
 
   /**
@@ -50,7 +50,39 @@
     this->setSize2D(50, 10);
 
-    this->value = 0.5f;
-    this->minimum = 0.0f;
-    this->maximum = 1.0f;
+    this->_minimum = 0.0f;
+    this->_maximum = 1.0f;
+    this->setValue(0.5f);
+    this->resize();
+  }
+
+  void GLGuiBar::setValue(float value)
+  {
+    if (value > _maximum)
+    {
+      value = _maximum;
+      PRINTF(2)("Oversteped range, set Value to %f\n", _maximum);
+    }
+    if (value < _minimum)
+    {
+      value = _minimum;
+      PRINTF(2)("Oversteped range, set Value to %f\n", _minimum);
+    }
+
+    this->_value = value;
+
+    this->_frontRect.setRight(this->getSizeX2D() * (_value -_minimum)/ (_minimum + _maximum));
+  }
+  void GLGuiBar::setMinimum(float minimum)
+  {
+    this->_minimum = minimum;
+  }
+  void GLGuiBar::setMaximum(float maximum)
+  {
+    this->_maximum = maximum;
+  }
+  void GLGuiBar::setRange(float minimum, float maximum)
+  {
+    this->setMinimum(minimum);
+    this->setMaximum(maximum);
   }
 
@@ -59,6 +91,15 @@
     GLGuiWidget::resize();
 
+    this->_frontRect.setTopLeft(borderLeft(), borderTop());
+    this->_frontRect.setSize((this->getSizeX2D() - borderLeft() - borderRight()) * (_value -_minimum)/ (_minimum + _maximum)
+                             ,this->getSizeY2D() - borderTop() - borderBottom());
 
   }
+
+  void GLGuiBar::updateFrontColor()
+  {
+    this->font().setDiffuseColor(Color());
+  }
+
 
 
@@ -71,4 +112,8 @@
     GLGuiWidget::draw();
 
+    this->font().select();
+    glDisable(GL_BLEND);
+    this->drawRect(this->_frontRect);
+
     this->endDraw();
   }
Index: /trunk/src/lib/gui/gl/glgui_bar.h
===================================================================
--- /trunk/src/lib/gui/gl/glgui_bar.h	(revision 8982)
+++ /trunk/src/lib/gui/gl/glgui_bar.h	(revision 8983)
@@ -26,11 +26,12 @@
     virtual ~GLGuiBar();
 
-    void setValue(float value) { this->value = value; };
-    void setMinimum(float minimum) { this->minimum = minimum; };
-    void setMaximum(float maximum) { this->maximum = maximum; };
+    void setValue(float value);
+    void setMinimum(float minimum);
+    void setMaximum(float maximum);
+    void setRange(float minimum, float maximum);
 
-    float getValue() const { return this->value; };
-    float getMinimum() const { return this->minimum; };
-    float getMaximum() const { return this->maximum; };
+    float getValue() const { return this->_value; };
+    float getMinimum() const { return this->_minimum; };
+    float getMaximum() const { return this->_maximum; };
 
     virtual void update() { };
@@ -39,4 +40,5 @@
   protected:
     virtual void resize();
+    virtual void updateFrontColor();
 
   private:
@@ -44,8 +46,10 @@
 
   private:
-    float value;
+    float         _value;
 
-    float minimum;
-    float maximum;
+    Rect2D        _frontRect;
+
+    float         _minimum;
+    float         _maximum;
   };
 }
Index: /trunk/src/lib/gui/gl/glgui_widget.h
===================================================================
--- /trunk/src/lib/gui/gl/glgui_widget.h	(revision 8982)
+++ /trunk/src/lib/gui/gl/glgui_widget.h	(revision 8983)
@@ -119,6 +119,8 @@
     /** @returns FeaturePosition */
     inline FeaturePosition featurePosition() const { return _featurePosition; }
+    /** @returns the constant font */
+    inline const Font& font() const { return _font; }
     /** @returns the font */
-    inline const Font& font() const { return _font; }
+    inline Font& font() { return _font; }
     /** @returns true if the Element is Animated */
     inline bool animating() const { return _animating; }
Index: /trunk/src/world_entities/elements/glgui_energywidget.cc
===================================================================
--- /trunk/src/world_entities/elements/glgui_energywidget.cc	(revision 8982)
+++ /trunk/src/world_entities/elements/glgui_energywidget.cc	(revision 8983)
@@ -26,4 +26,6 @@
   {
     //   this->setClassID(CL_PROTO_ID, "GLGuiEnergyWidget");
+
+    this->_bar.setSize2D(100, 30);
     this->pack(&this->_name);
     this->pack(&this->_valueText);
@@ -36,4 +38,7 @@
     this->_valueText.setBackgroundTexture("maps/gui_element_background_2.png");
     this->_bar.setBackgroundTexture(Texture());
+    this->_bar.setBackgroundColor(Color(0,0,0,0));
+    this->_bar.setForegroundColor(Color(1, 1, 1, 1));
+    this->_bar.font().setBlendFunc(GL_SRC_ALPHA, GL_DST_ALPHA);
   }
 
@@ -50,4 +55,5 @@
   {
     this->_name.setText(name);
+    this->_bar.setWidgetSize(this->_name.getSize2D());
   }
 
Index: /trunk/src/world_entities/weapons/test_gun.cc
===================================================================
--- /trunk/src/world_entities/weapons/test_gun.cc	(revision 8982)
+++ /trunk/src/world_entities/weapons/test_gun.cc	(revision 8983)
@@ -32,7 +32,4 @@
 
 #include "fast_factory.h"
-
-
-using namespace std;
 
 CREATE_FACTORY(TestGun, CL_TEST_GUN);
@@ -123,6 +120,6 @@
   this->setStateDuration(WS_DEACTIVATING, .4);
 
-  this->setEnergyMax(100000);
-  this->increaseEnergy(100000);
+  this->setEnergyMax(10000);
+  this->increaseEnergy(1000);
   //this->minCharge = 2;
 
@@ -133,5 +130,5 @@
   this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
   this->setProjectileType(CL_LASER);
-  this->prepareProjectiles(20);
+  this->prepareProjectiles(100);
 
 }
