| Package | org.flintparticles.common.initializers |
| Interface | public interface Initializer extends Behaviour |
| Implementors | InitializerBase, TweenToZone |
An Initializer is a class that is used to set properties of a particle when it is created. Initializers may, for example, set an initial velocity for a particle.
Initializers are directly associated with emitters and act on all particles created by that emitter. Initializers are applied to all particles created by an emitter by using the emitter's addInitializer method. Initializers are removed from the emitter by using the emitter's removeInitializer method.
The key method in the Initializer interface is the initiaize method. This is called for every particle and is where the initializer modifies the particle's properties.
See also
| Method | Defined By | ||
|---|---|---|---|
![]() | addedToEmitter(emitter:Emitter):void
The addedToEmitter method is called by the emitter when the Behaviour is
added to it. | Behaviour | |
The initialize method is used by the emitter to apply the initialization
to every particle. | Initializer | ||
![]() | removedFromEmitter(emitter:Emitter):void
The removedFromEmitter method is called by the emitter when the Behaviour
is removed from it. | Behaviour | |
| initialize | () | method |
public function initialize(emitter:Emitter, particle:Particle):voidThe initialize method is used by the emitter to apply the initialization to every particle. It is the key feature of the initializers and is used to initialize the state of every particle. This method is called within the emitter's createParticle method for every particle and need not be called by the user.
Parameters
emitter:Emitter — The Emitter that created the particle.
| |
particle:Particle — The particle to be initialized.
|