#include <sprite.h>
Inherits Graphic.
Inherited by AnimSprite, ChangeableSprite, MemData, MemDisplayMap, RobotBox, and RobotCommand.
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. | |
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.
| 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 | ( | ) |
| 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 | ( | ) |
Reimplemented in MemData, MemDisplayMap, ChangeableSprite, RobotBox, and RobotCommand.
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.
1.5.7.1