| Package | org.flintparticles.common.initializers |
| Class | public class ImageClasses |
| Inheritance | ImageClasses ImageInitializerBase InitializerBase Object |
This class includes an object pool for reusing DisplayObjects when particles die.
| Property | Defined By | ||
|---|---|---|---|
| images : Array [write-only] | ImageClasses | ||
![]() | 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 | |
| weights : Array [write-only] | ImageClasses | ||
| Method | Defined 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 | ||
![]() | 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 | ||
![]() | 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 | |
removeImage(image:*):void | ImageClasses | ||
| images | property |
images:Array [write-only] public function set images(value:Array):void| weights | property |
weights:Array [write-only] public function set weights(value:Array):void| 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.
Parametersimages: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
| addedToEmitter | () | method |
| addImage | () | method |
public function addImage(image:*, weight:Number = 1):voidParameters
image:* | |
weight:Number (default = 1) |
| createImage | () | method |
override public function createImage():ObjectUsed internally, this method creates an image object for displaying the particle by calling the constructor of one of the supplied image classes.
ReturnsObject |
| removeImage | () | method |
public function removeImage(image:*):voidParameters
image:* |