qaf::SpriteParticleObj Class Reference

#include <qafSpriteParticleObj.h>

Inheritance diagram for qaf::SpriteParticleObj:

qaf::GameObj List of all members.

Detailed Description

This is an object that renders itself as a sprite, with optional linear/angular speeds.

Its size and color values are interpolated linearly between the creation time and the lifetime parameter.

The size parameter is used to scale the sprite when rendered. If you want the sprite at its original size, use 1.0.

When its lifetime has expired, the object will remove itself from the Environment.

See also:
qaf::AnimParticleObj


Public Member Functions

 SpriteParticleObj (const hgeSprite *sprite, float x, float y, float angle, float vx, float vy, float vr, float ax, float ay, float initialSizeX, float initialSizeY, float finalSizeX, float finalSizeY, DWORD initialColor, DWORD finalColor, DWORD blendMode, float lifetime)
 
Parameters:
sprite The sprite used to render this particle.

hgeSprite * getSprite ()
 Returns a reference to the particle's sprite.
bool isDead ()
 Returns true if the particle's lifetime has expired.
void getPos (float *_x, float *_y, float *_angle)
 Returns the particle's current position.
void getVel (float *_vx, float *_vy, float *_vr)
 Returns the particle's current velocity.
DWORD getColor ()
 Returns the particle's current color.
DWORD getBlendMode ()
 Returns the particle's blend mode.
void getSize (float *xScale, float *yScale)
 Returns the particle's current size.
float getAge ()
 Returns how much time has passed since the particle was created.
void update (int objLayer, float dt)
void render (int objLayer, float scrollX, float scrollY)

Protected Attributes

hgeSprite sprite
float x
float y
float angle
float vx
float vy
float vr
float ax
float ay
float initialSizeX
float initialSizeY
float finalSizeX
float finalSizeY
float lifetime
int initialR
int initialG
int initialB
int initialA
int deltaR
int deltaG
int deltaB
int deltaA
DWORD blendMode
float timer


Constructor & Destructor Documentation

qaf::SpriteParticleObj::SpriteParticleObj ( const hgeSprite *  sprite,
float  x,
float  y,
float  angle,
float  vx,
float  vy,
float  vr,
float  ax,
float  ay,
float  initialSizeX,
float  initialSizeY,
float  finalSizeX,
float  finalSizeY,
DWORD  initialColor,
DWORD  finalColor,
DWORD  blendMode,
float  lifetime 
)

Parameters:
sprite The sprite used to render this particle.

Parameters:
x The object's initial X position.
y The object's initial Y position.
angle The object's initial rotation.
vx The object's X speed (pixels/second).
vy The object's Y speed (pixels/second).
vr The object's angular speed (radians/second).
ax The object's X acceleration (pixels/second2).
ay The object's Y acceleration (pixels/second2).
initialSizeX The sprite's initial horiz. scale.
initialSizeY The sprite's initial horiz. scale.
finalSizeX The sprite's vert. scale when it is about to die.
finalSizeY The sprite's vert. scale when it is about to die.
initialColor The sprite's initial color.
finalColor The sprite's color when it is about to die.
blendMode The blend mode used to render the sprite.
lifetime The object's lifetime, in seconds.


Member Function Documentation

void qaf::SpriteParticleObj::getPos ( float *  _x,
float *  _y,
float *  _angle 
) [inline]

Returns the particle's current position.

Any of the parameters may be NULL, indicating that they shouldn't be returned.

void qaf::SpriteParticleObj::getVel ( float *  _vx,
float *  _vy,
float *  _vr 
) [inline]

Returns the particle's current velocity.

Any of the parameters may be NULL, indicating that they shouldn't be returned.


The documentation for this class was generated from the following file:
Generated on Sun Mar 25 12:32:14 2007 for Qaf Framework by  doxygen 1.5.1-p1