#include <qafAnimParticleObj.h>
Inheritance diagram for qaf::AnimParticleObj:
The size
parameter is used to scale the animation when rendered. If you want the animation at its original size, use 1.0.
When the animation has finished playing, the object will remove itself from the Environment
. If you create an AnimParticleObj
from an hgeAnimation
that has the HGEANIM_LOOP
flag set, the object will never delete itself and you are responsible for removing/deleting it.
The anim
object will be copied internally by AnimParticleObj
's constructor. The animation will be played from its first frame, as per the hgeAnimation::Play()
method.
Public Member Functions | ||||
AnimParticleObj (const hgeAnimation *anim, float x, float y, float angle, float vx, float vy, float vr, float ax, float ay, float sizeX=1.0f, float sizeY=1.0f, DWORD color=0xFFFFFFFF, DWORD blendMode=BLEND_DEFAULT) | ||||
| ||||
hgeAnimation * | getAnimation () | |||
Returns a reference to the particle's animation. | ||||
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. | ||||
void | getSize (float *xScale, float *yScale) | |||
Returns the particle's size. | ||||
void | update (int objLayer, float dt) | |||
void | render (int objLayer, float scrollX, float scrollY) | |||
Protected Attributes | ||||
hgeAnimation | anim | |||
float | x | |||
float | y | |||
float | angle | |||
float | vx | |||
float | vy | |||
float | vr | |||
float | ax | |||
float | ay | |||
float | sizeX | |||
float | sizeY |
qaf::AnimParticleObj::AnimParticleObj | ( | const hgeAnimation * | anim, | |
float | x, | |||
float | y, | |||
float | angle, | |||
float | vx, | |||
float | vy, | |||
float | vr, | |||
float | ax, | |||
float | ay, | |||
float | sizeX = 1.0f , |
|||
float | sizeY = 1.0f , |
|||
DWORD | color = 0xFFFFFFFF , |
|||
DWORD | blendMode = BLEND_DEFAULT | |||
) |
anim | The animation 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). | |
sizeX | The animation's horiz. scale. | |
sizeY | The animation's vert. scale. | |
color | The animation's color. | |
blendMode | The blend mode used to render the animation. |
void qaf::AnimParticleObj::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::AnimParticleObj::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.