Mana
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
AnimationParticle Class Reference

#include <animationparticle.h>

Inheritance diagram for AnimationParticle:
ImageParticle Particle Actor

Public Member Functions

 AnimationParticle (Map *map, Animation animation)
 
 AnimationParticle (Map *map, XML::Node animationNode, const std::string &dyePalettes=std::string())
 
 ~AnimationParticle () override
 
bool update () override
 Updates particle position, returns false when the particle should be deleted.
 
- Public Member Functions inherited from ImageParticle
 ImageParticle (Map *map, Image *image)
 Constructor.
 
 ~ImageParticle () override
 
bool draw (Graphics *graphics, int offsetX, int offsetY) const override
 Draws the particle image.
 
- Public Member Functions inherited from Particle
 Particle (Map *map)
 Constructor.
 
 ~Particle () override
 
void clear ()
 Deletes all child particles and emitters.
 
bool draw (Graphics *graphics, int offsetX, int offsetY) const override
 Draws the particle image.
 
bool drawnWhenBehind () const override
 Do not draw particles when behind other objects.
 
ParticlecreateChild ()
 Creates a blank particle as a child of the current particle Useful for creating target particles.
 
ParticleaddEffect (const std::string &particleEffectFile, int pixelX, int pixelY, int rotation=0)
 Creates a child particle that hosts some emitters described in the particleEffectFile.
 
ParticleaddTextSplashEffect (const std::string &text, int x, int y, const gcn::Color *color, gcn::Font *font, bool outline=false)
 Creates a standalone text particle.
 
ParticleaddTextRiseFadeOutEffect (const std::string &text, int x, int y, const gcn::Color *color, gcn::Font *font, bool outline=false)
 Creates a standalone text particle.
 
void addEmitter (ParticleEmitter *emitter)
 Adds an emitter to the particle.
 
void moveTo (const Vector &pos)
 Sets the position in 3 dimensional space in pixels relative to map.
 
void moveTo (float x, float y)
 Sets the position in 2 dimensional space in pixels relative to map.
 
void moveBy (const Vector &change)
 Changes the particle position relative.
 
void setLifetime (int lifetime)
 Sets the time in game ticks until the particle is destroyed.
 
void setFadeOut (int fadeOut)
 Sets the age of the pixel in game ticks where the particle has faded in completely.
 
void setFadeIn (int fadeIn)
 Sets the remaining particle lifetime where the particle starts to fade out.
 
void setVelocity (float x, float y, float z)
 Sets the current velocity in 3 dimensional space.
 
void setGravity (float gravity)
 Sets the downward acceleration.
 
void setRandomness (int r)
 Sets the ammount of random vector changes.
 
void setBounce (float bouncieness)
 Sets the ammount of velocity particles retain after hitting the ground.
 
void setFollow (bool follow)
 Sets the flag if the particle is supposed to be moved by its parent.
 
bool doesFollow () const
 Gets the flag if the particle is supposed to be moved by its parent.
 
void setDestination (Particle *target, float accel, float moment)
 Makes the particle move toward another particle with a given acceleration and momentum.
 
void setDieDistance (float dist)
 Sets the distance in pixel the particle can come near the target particle before it is destroyed.
 
void adjustEmitterSize (int w, int h)
 Changes the size of the emitters so that the effect fills a rectangle of this size.
 
void setAllowSizeAdjust (bool adjust)
 
bool isAlive () const
 
bool isExtinct () const
 Determines whether the particle and its children are all dead.
 
void kill ()
 Manually marks the particle for deletion.
 
void disableAutoDelete ()
 After calling this function the particle will only request deletion when kill() is called.
 
float getAlpha () const override
 Returns the current alpha value used to draw the actor.
 
void setAlpha (float alpha) override
 Sets the alpha value used to draw the actor.
 
virtual void setDeathEffect (const std::string &effectFile, char conditions)
 
- Public Member Functions inherited from Actor
 Actor ()
 
virtual ~Actor ()
 
const VectorgetPosition () const
 Returns the pixel position of this actor.
 
virtual void setPosition (const Vector &pos)
 Sets the pixel position of this actor.
 
int getPixelX () const
 Returns the pixels X coordinate of the actor.
 
int getPixelY () const
 Returns the pixel Y coordinate of the actor.
 
virtual int getDrawOrder () const
 Returns the pixel Y coordinate that the actor should be drawn at.
 
virtual int getTileX () const
 Returns the x coordinate in tiles of the actor.
 
virtual int getTileY () const
 Returns the y coordinate in tiles of the actor.
 
virtual void setMap (Map *map)
 
MapgetMap () const
 

Private Attributes

SimpleAnimation mAnimation
 Used animation for this particle.
 

Additional Inherited Members

- Public Types inherited from Particle
enum  AliveStatus {
  ALIVE = 0 , DEAD_TIMEOUT = 1 , DEAD_FLOOR = 2 , DEAD_SKY = 4 ,
  DEAD_IMPACT = 8 , DEAD_OTHER = 16 , DEAD_LONG_AGO = 128
}
 
- Static Public Member Functions inherited from Particle
static void setupEngine ()
 Gives a particle the properties of an engine root particle and loads the particle-related config settings.
 
- Static Public Attributes inherited from Particle
static const float PARTICLE_SKY = 800.0f
 Maximum Z position of particles.
 
static int fastPhysics = 0
 Mode of squareroot calculation.
 
static int particleCount = 0
 Current number of particles.
 
static int maxCount = 0
 Maximum number of particles.
 
static int emitterSkip = 1
 Duration of pause between two emitter updates in ticks.
 
static bool enabled = true
 true when non-crucial particle effects are disabled
 
- Protected Member Functions inherited from Particle
float getCurrentAlpha () const
 Calculates the current alpha transparency taking current fade status into account.
 
- Protected Attributes inherited from ImageParticle
ImagemImage
 The image used for this particle.
 
ResourceRef< ImagemImageRef
 
- Protected Attributes inherited from Particle
float mAlpha = 1.0f
 Opacity of the graphical representation of the particle.
 
int mLifetimeLeft = -1
 Lifetime left in game ticks.
 
int mLifetimePast = 0
 Age of the particle in game ticks.
 
int mFadeOut = 0
 Lifetime in game ticks left where fading out begins.
 
int mFadeIn = 0
 Age in game ticks where fading in is finished.
 
Vector mVelocity
 Speed in pixels per game-tick.
 
- Protected Attributes inherited from Actor
MapmMap = nullptr
 
Vector mPos
 Position in pixels relative to map.
 

Detailed Description

Definition at line 31 of file animationparticle.h.

Constructor & Destructor Documentation

◆ AnimationParticle() [1/2]

AnimationParticle::AnimationParticle ( Map map,
Animation  animation 
)

Definition at line 28 of file animationparticle.cpp.

◆ AnimationParticle() [2/2]

AnimationParticle::AnimationParticle ( Map map,
XML::Node  animationNode,
const std::string &  dyePalettes = std::string() 
)

Definition at line 34 of file animationparticle.cpp.

◆ ~AnimationParticle()

AnimationParticle::~AnimationParticle ( )
override

Definition at line 41 of file animationparticle.cpp.

Member Function Documentation

◆ update()

bool AnimationParticle::update ( )
overridevirtual

Updates particle position, returns false when the particle should be deleted.

Reimplemented from Particle.

Definition at line 47 of file animationparticle.cpp.

Member Data Documentation

◆ mAnimation

SimpleAnimation AnimationParticle::mAnimation
private

Used animation for this particle.

Definition at line 44 of file animationparticle.h.


The documentation for this class was generated from the following files: