Packageorg.flintparticles.common.initializers
Classpublic class ImageInitializerBase
InheritanceImageInitializerBase Inheritance InitializerBase Inheritance Object
Subclasses ImageClass, ImageClasses

The ImageInitializerBase is the base class for image initializers. It adds the option to pool the images for reuse after a particle dies and to fill the pool with a set of images in advance.



Public Properties
 PropertyDefined By
 Inheritedpriority : int
Returns a default priority of 0 for this action.
InitializerBase
  usePool : Boolean
Whether the images should be pooled for reuse when a particle dies
ImageInitializerBase
Protected Properties
 PropertyDefined By
  _emitters : Array
ImageInitializerBase
  _pool : Array
ImageInitializerBase
 Inherited_priority : int = 0
InitializerBase
  _usePool : Boolean
ImageInitializerBase
Public Methods
 MethodDefined By
  
ImageInitializerBase(usePool:Boolean = false, fillPool:uint = 0)
The constructor is usually called by the constructor of the class that extends this.
ImageInitializerBase
  
addedToEmitter(emitter:Emitter):void
[override] When added to an emitter, the initializer will start listening for dead particles so their images may be pooled.
ImageInitializerBase
  
clearPool():void
Clears the image pool, forcing all particles to be created anew.
ImageInitializerBase
  
createImage():Object
The method to create an image for a particle.
ImageInitializerBase
  
fillPool(count:uint):void
Fills the pool with a given number of particles.
ImageInitializerBase
  
initialize(emitter:Emitter, particle:Particle):void
[override] This method does nothing.
ImageInitializerBase
  
[override] When removed from an emitter, the initializer will stop listening for dead particles from that emitter.
ImageInitializerBase
Property Detail
_emittersproperty
protected var _emitters:Array

_poolproperty 
protected var _pool:Array

_usePoolproperty 
protected var _usePool:Boolean

usePoolproperty 
usePool:Boolean

Whether the images should be pooled for reuse when a particle dies


Implementation
    public function get usePool():Boolean
    public function set usePool(value:Boolean):void
Constructor Detail
ImageInitializerBase()Constructor
public function ImageInitializerBase(usePool:Boolean = false, fillPool:uint = 0)

The constructor is usually called by the constructor of the class that extends this.

Parameters
usePool:Boolean (default = false) — Whether the images should be pooled for reuse when a particle dies
 
fillPool:uint (default = 0) — How many images to create immediately for reuse as particles need them

See also

Method Detail
addedToEmitter()method
override public function addedToEmitter(emitter:Emitter):void

When added to an emitter, the initializer will start listening for dead particles so their images may be pooled. The initializer will only pool images that it created.

Parameters

emitter:Emitter

clearPool()method 
public function clearPool():void

Clears the image pool, forcing all particles to be created anew.

createImage()method 
public function createImage():Object

The method to create an image for a particle. This should be overridden in the class that extends this one.

Returns
Object
fillPool()method 
public function fillPool(count:uint):void

Fills the pool with a given number of particles.

Parameters

count:uint — The number of particles to create.

initialize()method 
override public function initialize(emitter:Emitter, particle:Particle):void

This method does nothing. All derived classes override this method to initialize each particle created by the emitter.

Parameters

emitter:Emitter
 
particle:Particle

removedFromEmitter()method 
override public function removedFromEmitter(emitter:Emitter):void

When removed from an emitter, the initializer will stop listening for dead particles from that emitter.

Parameters

emitter:Emitter