Changeset 4847 in orxonox.OLD for orxonox/trunk/src/lib/graphics/render2D/element_2d.h
- Timestamp:
- Jul 13, 2005, 6:25:44 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/render2D/element_2d.h
r4843 r4847 24 24 typedef enum 25 25 { 26 ELEM2D_ALIGN_NONE, 26 27 ELEM2D_ALIGN_LEFT, 27 28 ELEM2D_ALIGN_RIGHT, … … 30 31 } ELEM2D_ALIGNMENT; 31 32 33 //! A Struct defining the Position of an Element in 2D-space 34 struct Position2D 35 { 36 float x; //!< The x-coordinate. 37 float y; //!< The y-coordinate. 38 float depth; //!< The distance from the viewing plane. 39 40 }; 32 41 33 42 //! A class for ... … … 38 47 virtual ~Element2D(); 39 48 40 41 49 void setPosition(int xCoord, int yCoord); 42 50 void setLayer(E2DLayer layer); 51 /** @param visible true if the Element should be visible false otherwise (will not be rendered) */ 52 inline void setVisibility(bool visible) { this->visible = visible; }; 53 /** @param bindNode the Node this 2D-element should follow. if NULL the Element will not follow anything */ 54 inline void setBindNode(const PNode* bindNode) { this->bindNode = bindNode; }; 43 55 56 /** @returns the visibility state */ 57 inline bool isVisible() { return this->visible; }; 44 58 45 59 void positioning(); 60 virtual void tick(float dt); 46 61 virtual void draw() const = NULL; 47 62 63 private: 64 void init(); 65 48 66 private: 49 bool visible; 50 int position2D[2]; //!< X-coord, Y-Coord 51 E2DLayer layer; 67 bool visible; 68 int relPos2D[2]; //!< X-coord, Y-Coord (relative to the Coordinates of the alignment if given.) 69 Position2D absPos2D; //!< The absolute position of the 2D-Element. 70 E2DLayer layer; 52 71 53 ELEM2D_ALIGNMENT alignment;54 PNode*bindNode; //!< a node over which to display this 2D-element72 ELEM2D_ALIGNMENT alignment; //!< How the Element is aligned around its Position 73 const PNode* bindNode; //!< a node over which to display this 2D-element 55 74 }; 56 75
Note: See TracChangeset
for help on using the changeset viewer.