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


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()

Destruct the object.

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]

Retrieve the sprite associated with this object.

Reimplemented from SpriteSelector.

Reimplemented in AnimatedSprite.


The documentation for this class was generated from the following file: