| Package | org.flintparticles.common.initializers |
| Class | public class ImageClass |
| Inheritance | ImageClass ImageInitializerBase InitializerBase Object |
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.
| Property | Defined 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 | ||
![]() | priority : 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 | |
| Method | Defined 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 | ||
![]() | 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 [override]
Used internally, this method creates an image object for displaying the particle
by calling the image class constructor with the supplied parameters. | ImageClass | ||
![]() | fillPool(count:uint):void
Fills the pool with a given number of particles. | ImageInitializerBase | |
![]() | [override]
This method does nothing. | ImageInitializerBase | |
![]() | removedFromEmitter(emitter:Emitter):void [override]
When removed from an emitter, the initializer will stop listening for dead particles from that emitter. | ImageInitializerBase | |
| imageClass | property |
imageClass:ClassThe class to use when creating the particles' DisplayObjects.
public function get imageClass():Class public function set imageClass(value:Class):void| parameters | property |
parameters:ArrayThe parameters to pass to the constructor for the image class.
public function get parameters():Array public function set parameters(value:Array):void| 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.
ParametersimageClass: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
| createImage | () | method |
override public function createImage():ObjectUsed internally, this method creates an image object for displaying the particle by calling the image class constructor with the supplied parameters.
ReturnsObject |