a movable graphical object with a transparent background.
Definition at line 140 of file SpriteEngine.h.
Public Member Functions | |
Lifecycle management | |
Sprite (const AnimFrames *animFrames, Boolean visible, Boolean saveBackground) SEC_RAZOR_INIT | |
Create a single new sprite. | |
~Sprite () SEC_RAZOR_INIT | |
Destroy the Sprite and deallocate all used resources. | |
State management (visibility, position, etc.) | |
void | show () |
Show the sprite during subsequent draws. | |
void | hide () |
Hide the sprite during subsequent draws. | |
Boolean | setVisibility (Boolean visible) |
Set the visibility of the sprite through a flag. | |
Boolean | isVisible () const |
Will the sprite be drawn during subsequent draws? | |
void | setFrame (UInt16 frameIndex) |
Set the displayed frame of the Sprite. | |
void | move (Coord x, Coord y) |
Move the sprite (i.e. | |
Visual representation | |
void | draw (RectangleType *bounds=NULL) SEC_RAZOR |
Draw the sprite at its current location. | |
void | restoreBackground () const SEC_RAZOR |
Restore the saved background of the sprite. | |
void | discardBackground () SEC_RAZOR |
Throw away the background of a sprite. | |
Boolean | getBounds (RectangleType *bounds) const |
Get the screen space filled by the sprite. | |
Friends | |
class | SpriteGroup |
|
Create a single new sprite.
|
|
Destroy the Sprite and deallocate all used resources.
|
|
Show the sprite during subsequent draws.
|
|
Hide the sprite during subsequent draws.
|
|
Set the visibility of the sprite through a flag.
|
|
Will the sprite be drawn during subsequent draws?
|
|
Set the displayed frame of the Sprite.
|
|
Move the sprite (i.e. its hotspot) to the specified coordinates. |
|
Draw the sprite at its current location. If the sprite has been set to save its background, the background will be saved before the sprite will be drawn.
|
|
Restore the saved background of the sprite. This operation will not do anything if the sprite has been either not drawn, or the background has been discarded since the last draw operation. |
|
Throw away the background of a sprite.
|
|
Get the screen space filled by the sprite.
|
|
Definition at line 286 of file SpriteEngine.h. |