Planet
navi homeaboutscreenshotsdownloaddevelopmentforum

Element2D

ArchivePage?

An abstract SuperClass, that knows how to be drawn onto a 2-dimensional screen.

  • definition:
    ...
    #include "element_2d.h"
    ...
    //! A class that enables the
    class Crosshair : public PNode, public Element2D, public EventListener {
    ...
    }
    
  • usage:
        void setPosition2D(int xCoord, int yCoord);
        void setAlignment(E2D_ALIGNMENT alignment) { this->alignment = alignment; };
        void setLayer(E2D_LAYER layer);
        void setVisibility(bool visible) { this->visible = visible; };
        void setBindNode(const PNode* bindNode) { this->bindNode = bindNode; };
    
    These functions are quite selfexplanatory. Important are two things:
    1. you set only a relative-position with setPosition2D
    2. when you set a bindNode, the 2D-element will follow the BindNode?'s Position, trying to approximate it.
Last modified 9 years ago Last modified on Nov 28, 2007, 12:40:45 AM