Packageorg.flintparticles.common.initializers
Classpublic class ImageClass
InheritanceImageClass Inheritance ImageInitializerBase Inheritance InitializerBase Inheritance Object

The ImageClass Initializer sets the DisplayObject to use to draw the particle. 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.

To enable use of the object pool, it was necessary to alter the constructor so the parameters for the image class are passed as an array rather than as plain values.



Public Properties
 PropertyDefined By
  imageClass : Class
The class to use when creating the particles' DisplayObjects.
ImageClass
  parameters : Array
The parameters to pass to the constructor for the image class.
ImageClass
 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
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
  
ImageClass(imageClass:Class = null, parameters:Array = null, usePool:Boolean = false, fillPool:uint = 0)
The constructor creates an ImageClass initializer for use by an emitter.
ImageClass
 Inherited
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
 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 image class constructor with the supplied parameters.
ImageClass
 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
Property Detail
imageClassproperty
imageClass:Class

The class to use when creating the particles' DisplayObjects.


Implementation
    public function get imageClass():Class
    public function set imageClass(value:Class):void
parametersproperty 
parameters:Array

The parameters to pass to the constructor for the image class.


Implementation
    public function get parameters():Array
    public function set parameters(value:Array):void
Constructor Detail
ImageClass()Constructor
public function ImageClass(imageClass:Class = null, parameters:Array = null, usePool:Boolean = false, fillPool:uint = 0)

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

Parameters
imageClass:Class (default = null) — The class to use when creating the particles' DisplayObjects.
 
parameters:Array (default = null) — The parameters to pass to the constructor for the image class.
 
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
createImage()method
override public function createImage():Object

Used internally, this method creates an image object for displaying the particle by calling the image class constructor with the supplied parameters.

Returns
Object