Index: trunk/src/lib/graphics/render2D/element_2d.cc
===================================================================
--- trunk/src/lib/graphics/render2D/element_2d.cc	(revision 7329)
+++ trunk/src/lib/graphics/render2D/element_2d.cc	(revision 7330)
@@ -28,4 +28,7 @@
 
 #include "color.h"
+
+//#include "shell_command.h"
+//SHELL_COMMAND(debug, Element2D, debug2D);
 
 using namespace std;
@@ -209,4 +212,8 @@
   }
   this->layer = layer;
+
+
+  if (this->parent != NULL)
+    this->parent->children.sort(layerSortPredicate);
 }
 
@@ -510,5 +517,5 @@
 
 /**
- *  adds a child and makes this node to a parent
+ * @brief adds a child and makes this node to a parent
  * @param child child reference
  * @param parentMode on which changes the child should also change ist state
@@ -573,5 +580,5 @@
 
 /**
- * removes a child from the node
+ * @brief removes a child from the node
  * @param child the child to remove from this Node..
  *
@@ -693,5 +700,5 @@
 
 /**
- * does the reparenting in a very smooth way
+ * @brief does the reparenting in a very smooth way
  * @param parentName the name of the Parent to reconnect to
  * @param bias the speed to iterate to this new Positions
@@ -720,4 +727,15 @@
 {
   this->setParentMode2D(Element2D::stringToParentingMode2D(parentingMode));
+}
+
+/**
+ * @brief checks if elem1 is in a deeper layer as elem2
+ * @param elem1 the first Element2D
+ * @param elem2 the second Element2D
+ * @returns true if elem1->layer < elem2->layer
+ */
+bool Element2D::layerSortPredicate(const Element2D* elem1, const Element2D* elem2)
+{
+  return elem1->layer < elem2->layer;
 }
 
@@ -757,5 +775,5 @@
 
 /**
- *  updates the absCoordinate/absDirection
+ * @brief updates the absCoordinate/absDirection
  * @param dt The time passed since the last update
 
@@ -997,5 +1015,5 @@
 
 /**
- * displays the Element2D at its position with its rotation as a Plane.
+ * @brief displays the Element2D at its position with its rotation as a Plane.
  */
 void Element2D::debugDraw2D(unsigned int depth, float size, Vector color, unsigned int level) const
@@ -1061,5 +1079,5 @@
 // helper functions //
 /**
- * converts a parentingMode into a string that is the name of it
+ * @brief converts a parentingMode into a string that is the name of it
  * @param parentingMode the ParentingMode to convert
  * @return the converted string
@@ -1080,5 +1098,5 @@
 
 /**
- * converts a parenting-mode-string into a int
+ * @brief converts a parenting-mode-string into a int
  * @param parentingMode the string naming the parentingMode
  * @return the int corresponding to the named parentingMode
@@ -1099,5 +1117,5 @@
 
 /**
- * converts a layer into its corresponding string
+ * @brief converts a layer into its corresponding string
  * @param layer the layer to get the name-String of.
  * @returns the Name of the Layer (on error the default-layer-string is returned)
@@ -1107,24 +1125,22 @@
   switch(layer)
   {
+    case E2D_LAYER_ABOVE_ALL:
+      return "above-all";
     case E2D_LAYER_TOP:
       return "top";
-      break;
     case E2D_LAYER_MEDIUM:
       return "medium";
-      break;
     case E2D_LAYER_BOTTOM:
       return "bottom";
-      break;
     case E2D_LAYER_BELOW_ALL:
       return "below-all";
-      break;
     default:
+      assert (false);
       return layer2DToChar(E2D_DEFAULT_LAYER);
-      break;
-  }
-}
-
-/**
- * converts a String holding a actual Layer
+  }
+}
+
+/**
+ * @brief converts a String holding a actual Layer
  * @param layer the String to convert into a Layer2D
  * @returns the E2D_LAYER on success, E2D_DEFAULT_LAYER on error.
@@ -1132,5 +1148,7 @@
 E2D_LAYER Element2D::charToLayer2D(const std::string& layer)
 {
-  if (layer =="top")
+  if (layer == "above-all")
+    return (E2D_LAYER_ABOVE_ALL);
+  if (layer == "top")
     return (E2D_LAYER_TOP);
   else  if (layer == "medium")
Index: trunk/src/lib/graphics/render2D/element_2d.h
===================================================================
--- trunk/src/lib/graphics/render2D/element_2d.h	(revision 7329)
+++ trunk/src/lib/graphics/render2D/element_2d.h	(revision 7330)
@@ -24,9 +24,10 @@
   E2D_LAYER_MEDIUM              =     2,        //!< Will be rendered on the medium Layer.
   E2D_LAYER_TOP                 =     3,        //!< Will be rendered on top of everything else
-
-  E2D_LAYER_COUNT               =     4,         //!< The count of Layers.
+  E2D_LAYER_ABOVE_ALL           =     4,        //!< Will be rendered above everything else.
+
+  E2D_LAYER_COUNT               =     5,         //!< The count of Layers.
 } E2D_LAYER;
 #define E2D_DEFAULT_LAYER       E2D_LAYER_MEDIUM
-#define E2D_LAYER_ALL           4
+#define E2D_LAYER_ALL           5
 
 typedef enum
@@ -218,4 +219,6 @@
     static E2D_LAYER charToLayer2D(const std::string& layer);
 
+    static bool layerSortPredicate(const Element2D* elem1, const Element2D* elem2);
+
   private:
     void eraseChild2D(Element2D* child);
Index: trunk/src/lib/shell/shell.cc
===================================================================
--- trunk/src/lib/shell/shell.cc	(revision 7329)
+++ trunk/src/lib/shell/shell.cc	(revision 7330)
@@ -78,8 +78,10 @@
   // INPUT LINE
   this->shellInput = new ShellInput;
+  this->shellInput->setLayer(E2D_LAYER_ABOVE_ALL);
 
   this->backgroundMaterial = new Material;
   // Element2D and generals
   this->setAbsCoor2D(3, -400);
+  this->setLayer(E2D_LAYER_ABOVE_ALL);
   this->textSize = 20;
   this->lineSpacing = 0;
@@ -311,4 +313,5 @@
   {
     bufferText[i] = new Text(this->fontFile, this->textSize);
+    bufferText[i]->setLayer(E2D_LAYER_ABOVE_ALL);
     bufferText[i]->setAlignment(TEXT_ALIGN_LEFT);
     bufferText[i]->setParent2D(this);
Index: trunk/src/story_entities/game_world.cc
===================================================================
--- trunk/src/story_entities/game_world.cc	(revision 7329)
+++ trunk/src/story_entities/game_world.cc	(revision 7330)
@@ -276,5 +276,5 @@
   }
 
-  PRINTF(3)("GameWorld::mainLoop() - Exiting the main loop\n");
+  PRINTF(0)("GameWorld::mainLoop() - Exiting the main loop\n");
 }
 
