Packageorg.flintparticles.common.actions
Classpublic class Age
InheritanceAge Inheritance ActionBase Inheritance Object

The Age action operates in conjunction with the Lifetime initializer. The Lifetime initializer sets the lifetime for the particle. The Age action then ages the particle over time, altering its energy to reflect its age. This energy can then be used by actions like Fade and ColorChange to alter the appearence of the particle as it ages.

The aging process need not be linear. This action can use a function that modifies the aging process, to ease in or out or to alter the aging in other ways.

When the particle's lifetime is over, this action marks it as dead.

When adjusting the energy this action can use any of the easing functions in the org.flintparticles.common.energy package along with any custom easing functions that have the same interface.

See also

org.flintparticles.common.actions.Action
org.flintparticles.common.initializers.Lifetime
org.flintparticles.common.energy


Public Properties
 PropertyDefined By
  easing : Function
The easing function used to modify the energy over the lifetime of the particle.
Age
 Inheritedpriority : int
Returns a default priority of 0 for this action.
ActionBase
Protected Properties
 PropertyDefined By
 Inherited_priority : int = 0
ActionBase
Public Methods
 MethodDefined By
  
Age(easing:Function = null)
The constructor creates an Age action for use by an emitter.
Age
 Inherited
addedToEmitter(emitter:Emitter):void
This method does nothing.
ActionBase
 Inherited
This method does nothing.
ActionBase
  
update(emitter:Emitter, particle:Particle, time:Number):void
[override] Sets the energy of the particle based on its age and the easing function.
Age
Property Detail
easingproperty
easing:Function

The easing function used to modify the energy over the lifetime of the particle.


Implementation
    public function get easing():Function
    public function set easing(value:Function):void
Constructor Detail
Age()Constructor
public function Age(easing:Function = null)

The constructor creates an Age action for use by an emitter. To add an Age to all particles created by an emitter, use the emitter's addAction method.

Parameters
easing:Function (default = null) — an easing function to use to modify the energy curve over the lifetime of the particle. The default null produces a linear response with no easing.

See also

Method Detail
update()method
override public function update(emitter:Emitter, particle:Particle, time:Number):void

Sets the energy of the particle based on its age and the easing function.

This method is called by the emitter and need not be called by the user

Parameters

emitter:Emitter — The Emitter that created the particle.
 
particle:Particle — The particle to be updated.
 
time:Number — The duration of the frame - used for time based updates.

See also