Each Sprite is associated with an instance of AnimFrames. Several Sprites may share the same instance of AnimFrames if they have the same appearance. This is recommended, since it saves valuable resources.
All frames within an AnimFrames object share the same size, the same hotspot and the same mode of drawing.
Definition at line 46 of file SpriteEngine.h.
Public Member Functions | |
AnimFrames (const Canvas *canvas, UInt16 numFrames, DmResID bitmapID, DmResID maskID, Coord hotSpotX=0, Coord hotSpotY=0) SEC_RAZOR_INIT | |
Create an instance of a transparent AnimFrames. | |
AnimFrames (const Canvas *canvas, UInt16 numFrames, DmResID bitmapID, Coord hotSpotX=0, Coord hotSpotY=0) SEC_RAZOR_INIT | |
Create an instance of an opaque (not transparent) AnimFrames. | |
~AnimFrames () SEC_RAZOR_INIT | |
Destroy the AnimFrames and deallocate all used resources. | |
Boolean | getBounds (Coord x, Coord y, RectangleType *bounds) const |
Get the screen space filled by the AnimFrames when it is placed at the specified coordinates. | |
void | draw (UInt16 index, Coord x, Coord y, RectangleType *bounds=NULL) const SEC_RAZOR |
Draw a frame at the specified location. | |
Friends | |
class | Sprite |
|
Create an instance of a transparent AnimFrames. The frames will be constructed from bitmap resources in a resource database. The bitmap families for the frames need to be stored at IDs bitmapID..(bitmapID + numFrames) - 1. The 1bpp bitmaps for the transparency masks need to be stored at IDs maskID..(maskID + numFrames) - 1.
|
|
Create an instance of an opaque (not transparent) AnimFrames. The frames will be constructed from bitmap resources in a resource database. The bitmap families for the frames need to be stored at IDs bitmapID..(bitmapID + numFrames) - 1.
|
|
Destroy the AnimFrames and deallocate all used resources.
|
|
Get the screen space filled by the AnimFrames when it is placed at the specified coordinates.
|
|
Draw a frame at the specified location. Caution: Although this operation is publically accessible, you should know exactly what you are doing when you attempt to use it directly!!!
|
|
Definition at line 131 of file SpriteEngine.h. |