Packageorg.flintparticles.common.initializers
Classpublic class SharedImages
InheritanceSharedImages Inheritance InitializerBase Inheritance Object

The SharedImages 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 BitmapRenderer. When using the DisplayObjectRenderer the ImageClass Initializer must be used. With the BitmapRenderer, the DisplayObject is copied into the bitmap using the particle's property to place the image correctly. So many particles can share the same DisplayObject because it is only indirectly used to display the particle.

Default MXML Propertyimages



Public Properties
 PropertyDefined By
  images : Array
[write-only]
SharedImages
 Inheritedpriority : int
Returns a default priority of 0 for this action.
InitializerBase
  weights : Array
[write-only]
SharedImages
Protected Properties
 PropertyDefined By
 Inherited_priority : int = 0
InitializerBase
Public Methods
 MethodDefined By
  
SharedImages(images:Array = null, weights:Array = null)
The constructor creates a SharedImages initializer for use by an emitter.
SharedImages
  
addedToEmitter(emitter:Emitter):void
[override]
SharedImages
  
addImage(image:*, weight:Number = 1):void
SharedImages
  
initialize(emitter:Emitter, particle:Particle):void
[override] This method does nothing.
SharedImages
 Inherited
This method does nothing.
InitializerBase
  
removeImage(image:*):void
SharedImages
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
SharedImages()Constructor
public function SharedImages(images:Array = null, weights:Array = null)

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

Parameters
images:Array (default = null) — An array containing the DisplayObjects to use for each particle created by the emitter.
 
weights:Array (default = null) — The weighting to apply to each displayObject. If no weighting values are passed, the images are used with equal probability.

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)

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

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

Parameters

image:*