Index: code/branches/hud/src/orxonox/hud/Navigation.cc
===================================================================
--- code/branches/hud/src/orxonox/hud/Navigation.cc	(revision 1590)
+++ code/branches/hud/src/orxonox/hud/Navigation.cc	(revision 1595)
@@ -54,4 +54,5 @@
       , navMarker_(0)
       , aimMarker_(0)
+      , navText_(0)
       , focus_(0)
     {
@@ -81,23 +82,23 @@
         {
             // create container
-            this->container_ = static_cast<OverlayContainer*>(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", getName() + "_navContainer"));
-            this->container_->setMetricsMode(Ogre::GMM_RELATIVE);
-            this->container_->setLeft(0.0);
-            this->container_->setTop(0.0);
-            this->container_->setWidth(1.0);
-            this->container_->setHeight(1.0);
+            container_ = static_cast<OverlayContainer*>(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", getName() + "_navContainer"));
+            container_->setMetricsMode(Ogre::GMM_RELATIVE);
+            container_->setLeft(0.0);
+            container_->setTop(0.0);
+            container_->setWidth(1.0);
+            container_->setHeight(1.0);
 
             // create nav text
-            this->navText_ = static_cast<TextAreaOverlayElement*>(Ogre::OverlayManager::getSingleton().createOverlayElement("TextArea", getName() + "_navText"));
-            this->navText_->setMetricsMode(Ogre::GMM_RELATIVE);
-            this->navText_->setPosition(0.0f, 0.0f);
-            this->navText_->setCharHeight(0.05f);
-            this->navText_->setFontName("Monofur");
+            navText_ = static_cast<TextAreaOverlayElement*>(Ogre::OverlayManager::getSingleton().createOverlayElement("TextArea", getName() + "_navText"));
+            navText_->setMetricsMode(Ogre::GMM_RELATIVE);
+            navText_->setPosition(0.0f, 0.0f);
+            navText_->setCharHeight(0.05f);
+            navText_->setFontName("Monofur");
 
             // create nav marker
             navMarker_ = static_cast<PanelOverlayElement*>(OverlayManager::getSingleton().createOverlayElement("Panel", getName() + "_navMarker"));
             navMarker_->setMetricsMode(GMM_RELATIVE);
-            navMarker_->setDimensions(0.05f, 0.05f);
             navMarker_->setMaterialName("Orxonox/NavArrows");
+            this->navMarkerSize_ = 0.05;
             this->wasOutOfView_ = true; // just a to ensure the material is changed right the first time..
 
@@ -105,6 +106,6 @@
             aimMarker_ = static_cast<PanelOverlayElement*>(OverlayManager::getSingleton().createOverlayElement("Panel", getName() + "_aimMarker"));
             aimMarker_->setMetricsMode(GMM_RELATIVE);
-            aimMarker_->setDimensions(0.05f, 0.05f);
             aimMarker_->setMaterialName("Orxonox/NavCrosshair");
+            this->aimMarkerSize_ = 0.04;
             
             container_->addChild(navMarker_);
@@ -121,32 +122,29 @@
         XMLPortParam(Navigation, "navmarkersize", setNavMarkerSize, getNavMarkerSize, xmlElement, mode);
         XMLPortParam(Navigation, "aimmarkersize", setAimMarkerSize, getAimMarkerSize, xmlElement, mode);
-    }
-
-    void Navigation::setNavMarkerSize(Vector2 size)
-    {
-        if (this->navMarker_ && size.squaredLength() >= 0.0f)
-            this->navMarker_->setDimensions(size.x, size.y);
-    }
-
-    Vector2 Navigation::getNavMarkerSize() const
-    {
-        if (this->navMarker_)
-            return Vector2(navMarker_->getWidth(), navMarker_->getHeight());
-        else
-            return Vector2::ZERO;
-    }
-
-    void Navigation::setAimMarkerSize(Vector2 size)
-    {
-        if (this->aimMarker_ && size.squaredLength() >= 0.0f)
-            this->aimMarker_->setDimensions(size.x, size.y);
-    }
-
-    Vector2 Navigation::getAimMarkerSize() const
-    {
-        if (this->aimMarker_)
-            return Vector2(aimMarker_->getWidth(), aimMarker_->getHeight());
-        else
-            return Vector2::ZERO;
+
+        if (mode == XMLPort::LoadObject)
+        {
+            this->sizeChanged();
+        }
+    }
+
+    void Navigation::setNavMarkerSize(float size)
+    {
+        this->navMarkerSize_ = size;
+    }
+
+    float Navigation::getNavMarkerSize() const
+    {
+        return this->navMarkerSize_;
+    }
+
+    void Navigation::setAimMarkerSize(float size)
+    {
+        this->aimMarkerSize_ = size;
+    }
+
+    float Navigation::getAimMarkerSize() const
+    {
+        return this->aimMarkerSize_;
     }
 
@@ -208,5 +206,4 @@
             pos.x = -pos.x;
             pos.y = -pos.y;
-            pos.z = -pos.z;
         }
         else
@@ -366,11 +363,14 @@
     }
 
-    void Navigation::windowResized(int newWidth, int newHeight)
-    {
-        HUDOverlay::windowResized(newWidth, newHeight);
-
-        //if (this->navMarker_)
-        //    navMarker_->setDimensions(0.05, 0.05);
-
+    void Navigation::sizeChanged()
+    {
+        float xScale = this->getActualSize().x;
+        float yScale = this->getActualSize().y;
+        if (this->navMarker_)
+            navMarker_->setDimensions(navMarkerSize_ * xScale, navMarkerSize_ * yScale);
+        if (this->aimMarker_)
+            aimMarker_->setDimensions(aimMarkerSize_ * xScale, aimMarkerSize_ * yScale);
+        if (this->navText_)
+            navText_->setCharHeight(navText_->getCharHeight() * yScale);
     }
 }
