Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members

Sprite Class Reference

Sprite describes a single sprite, i.e. More...

#include <SpriteEngine.h>

List of all members.

Public Types

enum  OptimizationMode {
  optNONE = 0,
  optBUFFER = 1,
  optNO_MASK = 2
}

Public Methods

 Sprite (DmResID bitmapID, DmResID maskID = -1, Coord hotSpotX = 0, Coord hotSpotY = 0, Boolean visible = true, OptimizationMode optimizationMode = optNONE)
 Create a Sprite. More...

 ~Sprite ()
 Destroy the Sprite and deallocate all used resources. More...

void show ()
 Show the sprite during subsequent draws. More...

void hide ()
 Hide the sprite during subsequent draws. More...

Boolean setVisibility (Boolean visible)
 Set the visibility of the sprite through a flag. More...

Boolean isVisible () const
 Will the sprite be drawn during subsequent draws? More...

void move (Coord x, Coord y)
 Move the sprite (i.e. More...

void draw (RectangleType *bounds = NULL) const
 Draw the sprite at its current location. More...

void getBounds (RectangleType *bounds) const
 Get the screen space filled by the sprite. More...


Friends

class  SpriteGroup


Detailed Description

Sprite describes a single sprite, i.e.

a movable graphical object with a transparent background.

Definition at line 42 of file SpriteEngine.h.


Member Enumeration Documentation

enum Sprite::OptimizationMode
 

Enumeration values:
optNONE  
optBUFFER  
optNO_MASK  

Definition at line 46 of file SpriteEngine.h.


Constructor & Destructor Documentation

Sprite::Sprite ( DmResID bitmapID,
DmResID maskID = -1,
Coord hotSpotX = 0,
Coord hotSpotY = 0,
Boolean visible = true,
OptimizationMode optimizationMode = optNONE ) [inline]
 

Create a Sprite.

Parameters:
bitmapID   the ID of the image bitmap in the resource database.
maskID   the ID of the mask bitmap in the resource database.
hotSpotX   the horizontal offset of the hotspot.
hotSpotY   the vertical offset of the hotspot.
visible   shall the sprite be visible?
optimizationMode   which optimizations shall be applied?

Definition at line 64 of file SpriteEngine.h.

Sprite::~Sprite ( ) [inline]
 

Destroy the Sprite and deallocate all used resources.

Definition at line 140 of file SpriteEngine.h.


Member Function Documentation

void Sprite::draw ( RectangleType * bounds = NULL ) const [inline]
 

Draw the sprite at its current location.

Inquire the current draw window and allocate draw buffers as neccessary.

Parameters:
bounds   a pointer to a rectangle which will be filled with the screen space filled by the sprite, or NULL.

Definition at line 212 of file SpriteEngine.h.

void Sprite::getBounds ( RectangleType * bounds ) const [inline]
 

Get the screen space filled by the sprite.

Parameters:
bounds   a pointer to a rectangle which will be filled with the screen space filled by the sprite.

Definition at line 258 of file SpriteEngine.h.

Referenced by SpriteGroup::addSprite().

void Sprite::hide ( ) [inline]
 

Hide the sprite during subsequent draws.

Definition at line 166 of file SpriteEngine.h.

Boolean Sprite::isVisible ( ) const [inline]
 

Will the sprite be drawn during subsequent draws?

Definition at line 189 of file SpriteEngine.h.

Referenced by DemoActionEngine::nextPeriod().

void Sprite::move ( Coord x,
Coord y ) [inline]
 

Move the sprite (i.e.

its hotspot) to the specified coordinates.

Definition at line 198 of file SpriteEngine.h.

Referenced by Sprite(), DemoActionEngine::nextPeriod(), and DemoActionEngine::restoreState().

Boolean Sprite::setVisibility ( Boolean visible ) [inline]
 

Set the visibility of the sprite through a flag.

Parameters:
visible   shall the sprite be visible (true = shown / false = hidden)

Definition at line 177 of file SpriteEngine.h.

Referenced by DemoActionEngine::nextPeriod().

void Sprite::show ( ) [inline]
 

Show the sprite during subsequent draws.

Definition at line 157 of file SpriteEngine.h.


Friends And Related Function Documentation

class SpriteGroup [friend]
 

Definition at line 394 of file SpriteEngine.h.


The documentation for this class was generated from the following file:
Razor! Engine Developer's Guide. Copyright © by Tilo Christ. All Rights Reserved. Last updated: 4 Nov 2000