Packageorg.flintparticles.common.initializers
Classpublic class ColorsInit
InheritanceColorsInit Inheritance InitializerBase Inheritance Object

The ColorsInit initializer sets the color of the particle. It selects one of multiple colors, using optional weighting values to produce an uneven distribution for the colors.



Public Properties
 PropertyDefined By
  colors : Array
[write-only]
ColorsInit
 Inheritedpriority : int
Returns a default priority of 0 for this action.
InitializerBase
  weights : Array
[write-only]
ColorsInit
Protected Properties
 PropertyDefined By
 Inherited_priority : int = 0
InitializerBase
Public Methods
 MethodDefined By
  
ColorsInit(colors:Array = null, weights:Array = null)
The constructor creates a ColorsInit initializer for use by an emitter.
ColorsInit
  
addColor(color:uint, weight:Number = 1):void
ColorsInit
  
addedToEmitter(emitter:Emitter):void
[override]
ColorsInit
  
initialize(emitter:Emitter, particle:Particle):void
[override] This method does nothing.
ColorsInit
  
removeColor(color:uint):void
ColorsInit
 Inherited
This method does nothing.
InitializerBase
Property Detail
colorsproperty
colors:Array  [write-only]


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


Implementation
    public function set weights(value:Array):void
Constructor Detail
ColorsInit()Constructor
public function ColorsInit(colors:Array = null, weights:Array = null)

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

Parameters
colors:Array (default = null) — An array containing the Colors to use for each particle created by the emitter, as 32bit ARGB values.
 
weights:Array (default = null) — The weighting to apply to each color. If no weighting values are passed, the colors are all assigned a weighting of 1.

See also

Method Detail
addColor()method
public function addColor(color:uint, weight:Number = 1):void

Parameters

color:uint
 
weight:Number (default = 1)

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

Parameters

emitter:Emitter

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

removeColor()method 
public function removeColor(color:uint):void

Parameters

color:uint