Index: code/branches/fabienHS15/src/modules/overlays/hud/HUDWeaponMode.cc
===================================================================
--- code/branches/fabienHS15/src/modules/overlays/hud/HUDWeaponMode.cc	(revision 10688)
+++ code/branches/fabienHS15/src/modules/overlays/hud/HUDWeaponMode.cc	(revision 10721)
@@ -49,4 +49,7 @@
         RegisterObject(HUDWeaponMode);
 
+        weaponIndex_ = 0;
+        weaponModeIndex_ = 0;
+
         overlayElementIcon_ = static_cast<Ogre::PanelOverlayElement* >(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "HUDWeaponMode" + getUniqueNumberString()));
         overlayElementIcon_->setPosition(0.0f,0.0f);
@@ -80,9 +83,8 @@
         textOverlayLeft_->setPickPoint(Vector2(0.0f,0.0f));
         textOverlayLeft_->setVisible(true);
-        textOverlayLeft_->setAlignment(OverlayText::Left);
+        textOverlayLeft_->setAlignment(OverlayText::Center);
         textOverlayLeft_->setTextSize(0.02f);
         textOverlayLeft_->setColour(ColourValue(0.21,0.70,0.21,1.0));
-        textOverlayLeft_->setPosition(getPosition());
-        textOverlayLeft_->setAspectCorrection(this->getAspectCorrection());
+        textOverlayLeft_->setAspectCorrection(false);
         
         this->textOverlayRight_ = new OverlayText(this->getContext());
@@ -91,9 +93,8 @@
         textOverlayRight_->setPickPoint(Vector2(0.0f,0.0f));
         textOverlayRight_->setVisible(true);
-        textOverlayRight_->setAlignment(OverlayText::Left);
+        textOverlayRight_->setAlignment(OverlayText::Center);
         textOverlayRight_->setTextSize(0.02f);
         textOverlayRight_->setColour(ColourValue(0.21,0.70,0.21,1.0));
-        textOverlayRight_->setPosition(getPosition());
-        textOverlayRight_->setAspectCorrection(this->getAspectCorrection());        
+        textOverlayRight_->setAspectCorrection(false);
 
         materialNameState_ = "Orxonox/WSHUD_Reloading";
@@ -106,6 +107,11 @@
         if (this->isInitialized())
         {
-            //this->textOverlay_->destroy();            
-        }
+            //this->textOverlay_->destroy();
+        }
+    }
+
+    void HUDWeaponMode::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(HUDWeaponMode, XMLPort, xmlelement, mode);
     }
 
@@ -183,5 +189,12 @@
 
         positionHUDChilds();
-    }    
+    }
+
+    void HUDWeaponMode::sizeChanged()
+    {
+        OrxonoxOverlay::sizeChanged();
+
+        positionHUDChilds();
+    }
 
     void HUDWeaponMode::changedOwner()
@@ -190,6 +203,4 @@
 
         this->owner_ = orxonox_cast<Pawn*>(this->getOwner());
-
-        //updateWeaponsList();
     }
 
@@ -206,5 +217,6 @@
         SUPER(HUDWeaponMode, changedVisibility);
 
-        //this->textOverlay_->setVisible(this->isVisible());
+        this->textOverlayLeft_->setVisible(this->isVisible());
+        this->textOverlayRight_->setVisible(this->isVisible());
     }
 
@@ -248,11 +260,32 @@
                 overlayElementMunition_->setMaterialName("Orxonox/WSHUD_MunitionSeparate");
             }
-        }      
+        }
     }
 
     void HUDWeaponMode::positionHUDChilds()
     {
-        textOverlayLeft_->setPosition(getPosition() + Vector2(0.06f,0.0f));
-        textOverlayRight_->setPosition(getPosition() + Vector2(0.105f,0.0f));
-    }  
+        Vector2 size = Vector2(getSize().x*45.0f/150.0f, getSize().y);
+        Vector2 offset1 = Vector2(getSize().x*82.5f/150.0f, 0.0f);
+        Vector2 offset2 = Vector2(getSize().x*127.5f/150.0f, 0.0f);
+
+        textOverlayLeft_->setPosition(getPosition() + offset1);
+        textOverlayRight_->setPosition(getPosition() + offset2);
+
+        textOverlayLeft_->setSize(size);
+        textOverlayRight_->setSize(size);
+
+        textOverlayLeft_->setTextSize(getSize().y);
+        textOverlayRight_->setTextSize(getSize().y);
+    }
+
+    void HUDWeaponMode::updateSize()
+    {
+        this->setSize(weaponModeHUDActualSize_);
+        updatePosition();
+    }
+
+    void HUDWeaponMode::updatePosition()
+    {
+        this->setPosition(Vector2(weaponModeHUDActualSize_.x*weaponIndex_,weaponModeHUDActualSize_.y*weaponModeIndex_));
+    }      
 }
