Class hierarchy Compound list File list Compound Members
Object2D Class Reference
2D World Object. More...
Inherits SpriteSelector.
Inherited by AnimatedSprite.
List of all members.
Public Members
- Object2D (World2D* W, Object2D* Parent)
- Construct a 2D Object in a specified world, with a certain parent.
- ~Object2D ()
- Destruct the object.
- virtual long calcGlobalPosition (int AllTheWay=0)
- Calculate the object's global position.
- virtual long render ()
- Render the sprite to the current 2D view.
- virtual long advance (float Fraction)
- Move/Change the object state.
- virtual long add (Object* O)
- Add an object as a son.
- virtual long collision (Object2D* O)
- Check for collision with this 2D object.
- long setPosition (fVector2D P)
- Set the local (relative to parent) position.
- Vector2D& getGlobalPosition ()
- Retrieve the object's global position.
- fVector2D& getPosition ()
- Retrieve the object's local position.
- fVector2D getMiddle ()
- Retrieve the mid point of the object.
- virtual Sprite* getSprite ()
- Retrieve the sprite associated with this object.
Detailed Description
2D World Object.
Connects the concepts of a 2D World and the bitmap.
Provides movement and collision detection for sprites.
Member Function Documentation
Object2D::Object2D(World2D* W, Object2D* Parent)
Construct a 2D Object in a specified world, with a certain parent.
Using NULL for a parent causes the World to be the object's parent.
Object2D::~Object2D()
virtual long Object2D::calcGlobalPosition(int AllTheWay=0) [virtual]
Calculate the object's global position.
The global position
is relative to the world, whereas the object's (local) position
is relative to its parent.
Non-zero AllTheWay means that the calculation will recursively
go up the tree all the way to the root. Otherwise, the
calculation will only go up one level.
virtual long Object2D::render() [virtual]
Render the sprite to the current 2D view.
virtual long Object2D::advance(float Fraction) [virtual]
Move/Change the object state.
Defaults to nothing.
Reimplemented in AnimatedSprite.
virtual long Object2D::add(Object* O) [virtual]
Add an object as a son.
Any son must also be a Object2D.
virtual long Object2D::collision(Object2D* O) [virtual]
Check for collision with this 2D object.
long Object2D::setPosition(fVector2D P)
Set the local (relative to parent) position.
Vector2D& Object2D::getGlobalPosition()
Retrieve the object's global position.
The global position
is relative to the world, whereas the object's (local) position
is relative to its parent.
fVector2D& Object2D::getPosition()
Retrieve the object's local position.
fVector2D Object2D::getMiddle()
Retrieve the mid point of the object.
This point is relative to the parent.
virtual Sprite* Object2D::getSprite() [virtual]
The documentation for this class was generated from the following file: