Packageorg.flintparticles.twoD.particles
Classpublic class ParticleCreator2D
InheritanceParticleCreator2D Inheritance Object
Implements ParticleFactory

The ParticleCreator is used by the Emitter class to manage the creation and reuse of particles. To speed up the particle system, the ParticleCreator class maintains a pool of dead particles and reuses them when a new particle is needed, rather than creating a whole new particle.



Public Methods
 MethodDefined By
  
The constructor creates a ParticleCreator object.
ParticleCreator2D
  
Empties the particle pool.
ParticleCreator2D
  
Obtains a new Particle object.
ParticleCreator2D
  
disposeParticle(particle:Particle):void
Returns a particle to the particle pool for reuse
ParticleCreator2D
Constructor Detail
ParticleCreator2D()Constructor
public function ParticleCreator2D()

The constructor creates a ParticleCreator object.

Method Detail
clearAllParticles()method
public function clearAllParticles():void

Empties the particle pool.

createParticle()method 
public function createParticle():Particle

Obtains a new Particle object. The createParticle method will return a dead particle from the poll of dead particles or create a new particle if none are available.

Returns
Particle — a Particle object.
disposeParticle()method 
public function disposeParticle(particle:Particle):void

Returns a particle to the particle pool for reuse

Parameters

particle:Particle — The particle to return for reuse.