Index: trunk/src/lib/graphics/render2D/element_2d.cc
===================================================================
--- trunk/src/lib/graphics/render2D/element_2d.cc	(revision 5079)
+++ trunk/src/lib/graphics/render2D/element_2d.cc	(revision 5081)
@@ -177,4 +177,120 @@
 }
 
+
+void Element2D::setRelCoor2D (const Vector& relCoord)
+{
+}
+
+
+void Element2D::setRelCoor2D (float x, float y, float z)
+{
+}
+
+void Element2D::setRelCoorSoft2D(const Vector& relCoordSoft, float bias)
+{
+}
+
+void Element2D::setRelCoorSoft2D(float x, float y, float dontCare, float bias)
+{
+}
+
+void Element2D::setAbsCoor2D (const Vector& absCoord)
+{
+}
+
+void Element2D::setAbsCoor2D (float x, float y, float depth)
+{
+}
+
+void Element2D::shiftCoor (const Vector& shift)
+{
+}
+
+
+void Element2D::setRelDir2D (float relDir)
+{
+}
+
+void Element2D::setRelDirSoft2D(float relDirSoft, float bias)
+{
+}
+
+void Element2D::setAbsDir2D (float absDir)
+{
+}
+
+void Element2D::shiftDir (float shiftDir)
+{
+}
+
+
+void Element2D::addChild2D (Element2D* child, int parentingMod)
+{
+}
+
+void Element2D::addChild2D (const char* childName)
+{
+}
+
+void Element2D::removeChild2D (Element2D* child)
+{
+}
+
+void Element2D::remove2D()
+{
+}
+
+
+void Element2D::setParent2D (Element2D* parent)
+{
+}
+
+void Element2D::setParent2D (const char* parentName)
+{
+}
+
+
+void Element2D::softReparent(PNode* parentNode, float bias)
+{
+}
+
+void Element2D::softReparent(const char* parentName, float bias)
+{
+}
+
+
+void Element2D::setParentMode2D (const char* parentingMode)
+{
+}
+
+
+void Element2D::update2D (float dt)
+{
+}
+
+
+void Element2D::debug (unsigned int depth, unsigned int level) const
+{
+}
+
+void Element2D::debugDraw2D(unsigned int depth, float size, Vector color) const
+{
+}
+
+
+// helper functions //
+const char* Element2D::parentingModeToChar(int parentingMode)
+{
+}
+
+E2D_PARENT_MODE Element2D::charToParentingMode(const char* parentingMode)
+{
+}
+
+
+
+
+
+
 /**
  * ticks the 2d-Element
Index: trunk/src/lib/graphics/render2D/element_2d.h
===================================================================
--- trunk/src/lib/graphics/render2D/element_2d.h	(revision 5079)
+++ trunk/src/lib/graphics/render2D/element_2d.h	(revision 5081)
@@ -1,5 +1,6 @@
 /*!
  * @file element_2d.h
- * @brief Definition of the 2D elements rendered on top through the GraphicsEngine
+ * Definition of the 2D elements rendered on top through the GraphicsEngine
+ * @todo reimplement it, so it looks just like PNode.
 */
 
@@ -8,8 +9,10 @@
 
 #include "base_object.h"
+#include "vector.h"
 
 // FORWARD DECLARATION
 class PNode;
 class TiXmlElement;
+template<class T> class tList;
 
 //!< An enumerator defining the Depth of a 2D-element.
@@ -35,4 +38,16 @@
 } E2D_ALIGNMENT;
 
+typedef enum
+{
+  E2D_LOCAL_ROTATE          =   1,    //!< Rotates all the children around their centers.
+  E2D_ROTATE_MOVEMENT       =   2,    //!< Moves all the children around the center of their parent, without the rotation around their own centers.
+
+  E2D_MOVEMENT              =   4,    //!< Moves all children along with the parent.
+// special linkage modes
+  E2D_ALL                   =   3,    //!< Moves all children around the center of their parent, and also rotates their centers
+  E2D_ROTATE_AND_MOVE       =   5     //!< Rotates all children around their axis, and moves them as the Parent Moves, but does not rotate around the center of their parent.
+} E2D_PARENT_MODE;
+#define     E2D_DEFAULT_PARENTING_MODE  E2D_ALL
+
 //! A Struct defining the Position of an Element in 2D-space
 struct Position2D
@@ -82,4 +97,72 @@
     inline bool isActive() { return this->active; };
 
+
+    // LIKE PNODE
+  public:
+    void setRelCoor2D (const Vector& relCoord);
+    void setRelCoor2D (float x, float y, float dontCare);
+    void setRelCoorSoft2D(const Vector& relCoordSoft, float bias = 1.0);
+    void setRelCoorSoft2D(float x, float y, float dontCare, float bias = 1.0);
+    /** @returns the relative position */
+    inline const Vector& getRelCoor2D () const { return this->prevRelCoordinate; };
+    void setAbsCoor2D (const Vector& absCoord);
+    void setAbsCoor2D (float x, float y, float depth);
+    /** @returns the absolute position */
+    inline const Vector& getAbsCoor2D () const { return this->absCoordinate; };
+    void shiftCoor (const Vector& shift);
+
+    void setRelDir2D (float relDir);
+    void setRelDirSoft2D(float relDirSoft, float bias = 1.0);
+    /** @returns the relative Direction */
+    inline float getRelDir2D () const { return this->prevRelDirection; };
+    void setAbsDir2D (float absDir);
+    /** @returns the absolute Direction */
+    inline float getAbsDir2D () const { return this->absDirection; };
+    void shiftDir (float shiftDir);
+
+    /** @returns the Speed of the Node */
+    inline float getSpeed() const { return 0; };
+    /** @returns the Velocity of the Node */
+    inline const Vector& getVelocity() const { return this->velocity; };
+
+
+    void addChild2D (Element2D* child, int parentingMode = E2D_DEFAULT_PARENTING_MODE);
+    void addChild2D (const char* childName);
+    void removeChild2D (Element2D* child);
+    void remove2D();
+
+    void setParent2D (Element2D* parent);
+    void setParent2D (const char* parentName);
+    /** @returns the parent of this Element2D */
+    Element2D* getParent () const { return this->parent; };
+
+    void softReparent(PNode* parentNode, float bias = 1.0);
+    void softReparent(const char* parentName, float bias = 1.0);
+
+    /** @param parentMode sets the parentingMode of this Node */
+    void setParentMode2D (E2D_PARENT_MODE parentMode) { this->parentMode = parentMode; };
+    void setParentMode2D (const char* parentingMode);
+    /** @returns the Parenting mode of this node */
+    int getParentMode2D() const { return this->parentMode; };
+
+    void update2D (float dt);
+
+    void debug (unsigned int depth = 1, unsigned int level = 0) const;
+    void debugDraw2D(unsigned int depth = 1, float size = 1.0, Vector color = Vector(1,1,1)) const;
+
+    // helper functions //
+    static const char* parentingModeToChar(int parentingMode);
+    static E2D_PARENT_MODE charToParentingMode(const char* parentingMode);
+
+  private:
+    void init(Element2D* parent);
+    /** tells the child that the parent's Coordinate has changed */
+    inline void parentCoorChanged () { this->bRelCoorChanged = true; }
+    /** tells the child that the parent's Direction has changed */
+    inline void parentDirChanged () { this->bRelDirChanged = true; }
+    /** @returns the last calculated coordinate */
+    inline Vector getLastAbsCoor() { return this->lastAbsCoordinate; }
+
+  public:
     virtual void tick(float dt);
     virtual void draw() const = NULL;
@@ -99,4 +182,33 @@
     bool                    active;           //!< If the given Element2D is active.
     E2D_LAYER               layer;            //!< What layer this Element2D is on.
+
+
+
+
+
+  private:
+    bool              bRelCoorChanged;    //!< If Relative Coordinate has changed since last time we checked
+    bool              bRelDirChanged;     //!< If Relative Direction has changed since last time we checked
+
+    Vector            relCoordinate;      //!< coordinates relative to the parent
+    Vector            absCoordinate;      //!< absolute coordinates in the world ( from (0,0,0) )
+    float             relDirection;       //!< direction relative to the parent
+    float             absDirection;       //!< absolute direvtion in the world ( from (0,0,1) )
+
+    Vector            prevRelCoordinate;  //!< The last Relative Coordinate from the last update-Cycle.
+    Vector            lastAbsCoordinate;  //!< this is used for speedcalculation, it stores the last coordinate
+    float             prevRelDirection;   //!< The last Relative Direciton from the last update-Cycle.
+//  Quaternion        lastAbsDirection;
+
+    Vector            velocity;           //!< Saves the velocity.
+
+    Vector*           toCoordinate;       //!< a position to which to iterate. (This is used in conjunction with softReparent.and set*CoorSoft)
+    float*            toDirection;        //!< a direction to which to iterate. (This is used in conjunction with softReparent and set*DirSoft)
+    float             bias;               //!< how fast to iterate to the given position (default is 1)
+
+    Element2D*        parent;             //!< a pointer to the parent node
+    tList<Element2D>* children;           //!< list of the children of this Element2D
+
+    unsigned int      parentMode;         //!< the mode of the binding
 };
 
