Sprite Class Reference

#include <sprite.h>

Inheritance diagram for Sprite:

FloorItem Particle ImageParticle TextParticle AnimationParticle

List of all members.


Detailed Description

A sprite is some visible object on a map.

This abstract class defines the interface used by the map to sort and display the sprite.

Definition at line 31 of file sprite.h.


Public Member Functions

virtual ~Sprite ()
 Destructor.
virtual void draw (Graphics *graphics, int offsetX, int offsetY) const =0
 Draws the sprite to the given graphics context.
virtual int getWidth () const
 Returns the horizontal size of the sprites graphical representation in pixels or 0 when it is undefined.
virtual int getHeight () const
 Returns the vertical size of the sprites graphical representation in pixels or 0 when it is undefined.
virtual int getPixelY () const =0
 Returns the pixel Y coordinate of the sprite.

Constructor & Destructor Documentation

virtual Sprite::~Sprite (  )  [inline, virtual]

Destructor.

Definition at line 38 of file sprite.h.


Member Function Documentation

virtual void Sprite::draw ( Graphics graphics,
int  offsetX,
int  offsetY 
) const [pure virtual]

Draws the sprite to the given graphics context.

Note: this function could be simplified if the graphics context would support setting a translation offset. It already does this partly with the clipping rectangle support.

Implemented in FloorItem, ImageParticle, Particle, and TextParticle.

virtual int Sprite::getWidth ( void   )  const [inline, virtual]

Returns the horizontal size of the sprites graphical representation in pixels or 0 when it is undefined.

Definition at line 53 of file sprite.h.

virtual int Sprite::getHeight ( void   )  const [inline, virtual]

Returns the vertical size of the sprites graphical representation in pixels or 0 when it is undefined.

Definition at line 60 of file sprite.h.

virtual int Sprite::getPixelY (  )  const [pure virtual]

Returns the pixel Y coordinate of the sprite.

Implemented in FloorItem, Particle, and TextParticle.


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

Generated on Sun Apr 26 17:30:44 2009 for The Mana World by  doxygen 1.5.5