Index: code/branches/spaceboundaries/src/orxonox/worldentities/SpaceBoundaries.cc
===================================================================
--- code/branches/spaceboundaries/src/orxonox/worldentities/SpaceBoundaries.cc	(revision 8163)
+++ code/branches/spaceboundaries/src/orxonox/worldentities/SpaceBoundaries.cc	(revision 8164)
@@ -37,5 +37,12 @@
 /* Eigene, spezifische include-Statements*/
 #include "worldentities/MobileEntity.h"
+#include "worldentities/ControllableEntity.h"
 #include "core/ObjectListIterator.h"
+#include <worldentities/pawns/Pawn.h>
+#include <infos/PlayerInfo.h>
+
+#include <OgreTextAreaOverlayElement.h>
+#include <OgreOverlayManager.h>
+#include <overlays/OverlayText.h>
 
 namespace orxonox
@@ -46,10 +53,11 @@
     {
         RegisterObject(SpaceBoundaries);
-        
+        COUT(0) << "Test ob Konstruktor aufgerufen wird." << std::endl; //!< message for debugging
         // Show Boundaries on the radar.
+         m_pColoredTextAreaOverlayElementFactory = new ColoredTextAreaOverlayElementFactory();
     }
     SpaceBoundaries::~SpaceBoundaries()
     {
-    
+        delete pColoredTextAreaOverlayElementFactory;
     }
     
@@ -94,12 +102,33 @@
         for(ObjectListIterator<MobileEntity> item = ObjectList<MobileEntity>::begin(); item != ObjectList<MobileEntity>::end(); ++item)
         {
-            float distance = computeDistance((WorldEntity *)&item); // fuer casts gibt's scheinbar andere, neuere Variante --> vgl. Coding-Guide und andere Files
-            if(distance > this->warnDistance && distance < this->maxDistance)
+            MobileEntity* myMobileEntity = *item;
+            Pawn* myItem = dynamic_cast<Pawn*>(myMobileEntity);
+            //COUT(0) << "Die for-Schleife wird erreicht!!!" << std::endl; //!< message for debugging
+            if(myItem != NULL)
             {
-                COUT(0) << "You are leaving the area" << std::endl; //!< message for debugging
-                // Display Warning on Screen if the humanPlayer (infos/PlayerInfo.h) is leaving the area
-            } else if(distance > maxDistance)
-            {
-                // Decrease Health
+                float distance = computeDistance((WorldEntity*) myItem);
+                bool humanItem = this->isHumanPlayer(myItem);
+                COUT(0) << "Pawn wird erkannt!!!" << std::endl; //!< message for debugging
+                COUT(0) << "Distanz:" << distance << std::endl; //!< message for debugging
+                if(distance > this->warnDistance /*&& distance < this->maxDistance*/)
+                {
+                    COUT(0) << "You are leaving the area" << std::endl; //!< message for debugging
+                    if(humanItem)
+                    {
+                        COUT(0) << "humanItem ist true" << std::endl;
+                        this->displayWarning("Attention! You are leaving the area!");
+                    } else {
+                    
+                    }
+                } else if(distance > maxDistance)
+                {
+                    // Decrease Health
+                    if(humanItem)
+                    {
+                        
+                    } else {
+                    
+                    }
+                }
             }
         }
@@ -109,8 +138,43 @@
     {
         Vector3 itemPosition = item->getPosition();
-        return (itemPosition.distance(center));
-    }
-    
-    
+        return (itemPosition.distance(this->center));
+    }
+    
+    void SpaceBoundaries::displayWarning(const std::string warnText)
+    {   /*
+        Ogre::TextAreaOverlayElement *pTextArea;
+        Ogre::OverlayManager manager = Ogre::OverlayManager();
+        Ogre::OverlayElement temp = manager.createOverlayElement("TextArea", "MyTextArea");
+        //pTextArea = (Ogre::TextAreaOverlayElement *) 
+       // pTextArea->setCaption("Some plain text");
+    
+        Ogre::TextAreaOverlayElement warning(warnText);
+        warning.initialise();
+        //warning.setPosition(0.2, 0.2);
+        
+
+        COUT(0) << "Breite des Warntextes: " << warning.getWidth() << std::endl;
+        COUT(0) << "Hoehe des Warntextes: " << warning.getHeight() << std::endl;
+        
+        warning.show();*/
+        // Register the overlay element
+         OverlayManager::getSingleton().addOverlayElementFactory(pColoredTextAreaOverlayElementFactory);
+         
+        Ogre::TextAreaOverlayElement *pTextArea =
+                (Ogre::TextAreaOverlayElement*)Ogre::OverlayManager.createOverlayElement("TextArea", "MyTextArea");
+        pTextArea->setCaption("Some plain text");
+
+        
+    }
+    
+    bool SpaceBoundaries::isHumanPlayer(Pawn *item)
+    {
+        if(item != NULL)
+        {
+            return item->getPlayer()->isHumanPlayer();
+        } else {
+            return false;
+        }
+    }
     
     
Index: code/branches/spaceboundaries/src/orxonox/worldentities/SpaceBoundaries.h
===================================================================
--- code/branches/spaceboundaries/src/orxonox/worldentities/SpaceBoundaries.h	(revision 8163)
+++ code/branches/spaceboundaries/src/orxonox/worldentities/SpaceBoundaries.h	(revision 8164)
@@ -32,5 +32,4 @@
 /* Folgender Block ist Copy-Paste und somit teilweise wohl unnoetig */
 #include "OrxonoxPrereqs.h"
-#include <string>
 #include "core/SubclassIdentifier.h"
 
@@ -40,4 +39,8 @@
 #include "worldentities/StaticEntity.h"
 #include "worldentities/WorldEntity.h"
+
+#include <ColoredTextAreaOverlayElementFactory.h>
+
+#include <string>
 
 
@@ -69,4 +72,7 @@
         
             float computeDistance(WorldEntity *item); //!< Auf den Mittelpunkt 'center' bezogen.
+            void displayWarning(const std::string warnText);
+            bool isHumanPlayer(Pawn *item);
+            ColoredTextAreaOverlayElementFactory* pColoredTextAreaOverlayElementFactory;
     };
 }
