#include <qafSpriteParticleObj.h>
Inheritance diagram for qaf::SpriteParticleObj:
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
.
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) | ||||
| ||||
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 |
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 | |||
) |
sprite | The sprite used to render this particle. |
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. |
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.