Sprite Class Reference
[Toolkit classes]

A Graphic class that represents a single image. More...

#include <sprite.h>

Inherits Graphic.

Inherited by AnimSprite, ChangeableSprite, MemData, MemDisplayMap, RobotBox, and RobotCommand.

Collaboration diagram for Sprite:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Sprite ()
 Null sprite.
 Sprite (int type)
 Creates a sprite of the given type, offscreen.
 Sprite (int type, Point location)
 Creates a sprite of the given type at (location).
 Sprite (int type, int x, int y)
 Creates a sprite of the given type at (x, y).
 ~Sprite ()
void draw (BITMAP *canvas, Point offset)
 The basic draw() function.
int getType ()

Protected Attributes

BITMAP * sprite
 The image this object will display.
int type
 A code, specified by an enum, that describes what kind of Sprite this is.


Detailed Description

A Graphic class that represents a single image.

This is the most basic implementation of Graphic. Any kind of object that doesn't need any sort of higher functionality should be a Sprite.


Constructor & Destructor Documentation

Sprite::Sprite (  ) 

Null sprite.

Note that draw() checks for a null pointer, so this won't throw errors.

Sprite::Sprite ( int  type  ) 

Creates a sprite of the given type, offscreen.

Sprite::Sprite ( int  type,
Point  location 
)

Creates a sprite of the given type at (location).

Sprite::Sprite ( int  type,
int  x,
int  y 
)

Creates a sprite of the given type at (x, y).

Sprite::~Sprite (  ) 


Member Function Documentation

void Sprite::draw ( BITMAP *  canvas,
Point  offset 
) [virtual]

The basic draw() function.

This is literally

draw_sprite(canvas, sprite, (location + offset));

although the position has to be split back into x and y components.

Implements Graphic.

Reimplemented in MemData, MemDisplayMap, ChangeableSprite, RobotBox, and RobotCommand.

int Sprite::getType (  ) 


Member Data Documentation

BITMAP* Sprite::sprite [protected]

The image this object will display.

int Sprite::type [protected]

A code, specified by an enum, that describes what kind of Sprite this is.

Reimplemented in ChangeableSprite.


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

Generated on Mon Mar 16 14:33:15 2009 for LearningGaming by  doxygen 1.5.7.1