Packageorg.flintparticles.common.particles
Interfacepublic interface ParticleFactory
Implementors ParticleCreator2D, ParticleCreator3D

The ParticleFactory interface defines the interface for any factory class used by emitters to create, reuse and dispose of particles. To speed up the particle system, a ParticleFactory will usually maintain a pool of dead particles and reuse them when a new particle is needed, rather than creating a whole new particle. The default ParticleFactory used by the Emitter is an instance of the appropriate ParticleCreator class.

See also

org.flintparticles.twoD.particles.ParticleCreator2D
org.flintparticles.threeD.particles.ParticleCreator3D


Public Methods
 MethodDefined By
  
Clear all cached particles from the factory
ParticleFactory
  
To obtain a new Particle object.
ParticleFactory
  
disposeParticle(particle:Particle):void
Indicates a particle is no longer required.
ParticleFactory
Method Detail
clearAllParticles()method
public function clearAllParticles():void

Clear all cached particles from the factory

createParticle()method 
public function createParticle():Particle

To obtain a new Particle object. If using a pool of particles the particle factory will usually return a particle from the pool and only creates a new particle if the pool is empty.

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

Indicates a particle is no longer required. If using a pool of particles the particle factory will return the particle to the pool for reuse later.

Parameters

particle:Particle — The particle to return for reuse.