Packageorg.flintparticles.common.initializers
Classpublic class ImageClasses
InheritanceImageClasses Inheritance ImageInitializerBase Inheritance InitializerBase Inheritance Object

The ImageClasses Initializer sets the DisplayObject to use to draw the particle. It selects one of multiple images that are passed to it. It is used with the DisplayObjectRenderer. When using the BitmapRenderer it is more efficient to use the SharedImage Initializer.

This class includes an object pool for reusing DisplayObjects when particles die.



Public Properties
 PropertyDefined By
  images : Array
[write-only]
ImageClasses
 Inheritedpriority : int
Returns a default priority of 0 for this action.
InitializerBase
 InheritedusePool : Boolean
Whether the images should be pooled for reuse when a particle dies
ImageInitializerBase
  weights : Array
[write-only]
ImageClasses
Protected Properties
 PropertyDefined By
 Inherited_emitters : Array
ImageInitializerBase
 Inherited_pool : Array
ImageInitializerBase
 Inherited_priority : int = 0
InitializerBase
 Inherited_usePool : Boolean
ImageInitializerBase
Public Methods
 MethodDefined By
  
ImageClasses(images:Array = null, weights:Array = null, usePool:Boolean = false, fillPool:uint = 0)
The constructor creates a ImageClasses initializer for use by an emitter.
ImageClasses
  
addedToEmitter(emitter:Emitter):void
[override]
ImageClasses
  
addImage(image:*, weight:Number = 1):void
ImageClasses
 Inherited
clearPool():void
Clears the image pool, forcing all particles to be created anew.
ImageInitializerBase
  
createImage():Object
[override] Used internally, this method creates an image object for displaying the particle by calling the constructor of one of the supplied image classes.
ImageClasses
 Inherited
fillPool(count:uint):void
Fills the pool with a given number of particles.
ImageInitializerBase
 Inherited
initialize(emitter:Emitter, particle:Particle):void
[override] This method does nothing.
ImageInitializerBase
 Inherited
[override] When removed from an emitter, the initializer will stop listening for dead particles from that emitter.
ImageInitializerBase
  
removeImage(image:*):void
ImageClasses
Property Detail
imagesproperty
images:Array  [write-only]


Implementation
    public function set images(value:Array):void
weightsproperty 
weights:Array  [write-only]


Implementation
    public function set weights(value:Array):void
Constructor Detail
ImageClasses()Constructor
public function ImageClasses(images:Array = null, weights:Array = null, usePool:Boolean = false, fillPool:uint = 0)

The constructor creates a ImageClasses initializer for use by an emitter. To add a ImageClasses to all particles created by an emitter, use the emitter's addInitializer method.

Parameters
images:Array (default = null) — An array containing the classes to use for each particle created by the emitter. Each item in the array may be a class or an array containing a class and a number of parameters to pass to the constructor.
 
weights:Array (default = null) — The weighting to apply to each displayObject. If no weighting values are passed, the images are used with equal probability.
 
usePool:Boolean (default = false) — Indicates whether particles should be reused when a particle dies.
 
fillPool:uint (default = 0) — Indicates how many particles to create immediately in the pool, to avoid creating them when the particle effect is running.

See also

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

Parameters

emitter:Emitter

addImage()method 
public function addImage(image:*, weight:Number = 1):void

Parameters

image:*
 
weight:Number (default = 1)

createImage()method 
override public function createImage():Object

Used internally, this method creates an image object for displaying the particle by calling the constructor of one of the supplied image classes.

Returns
Object
removeImage()method 
public function removeImage(image:*):void

Parameters

image:*