Packageorg.flintparticles.common.initializers
Classpublic class Lifetime
InheritanceLifetime Inheritance InitializerBase Inheritance Object

The Lifetime Initializer sets a lifetime for the particle. It is usually combined with the Age action to age the particle over its lifetime and destroy the particle at the end of its lifetime.



Public Properties
 PropertyDefined By
  lifetime : Number
When reading, returns the average of minLifetime and maxLifetime.
Lifetime
  maxLifetime : Number
The maximum lifetime for particles initialised by this initializer.
Lifetime
  minLifetime : Number
The minimum lifetime for particles initialised by this initializer.
Lifetime
 Inheritedpriority : int
Returns a default priority of 0 for this action.
InitializerBase
Protected Properties
 PropertyDefined By
 Inherited_priority : int = 0
InitializerBase
Public Methods
 MethodDefined By
  
Lifetime(minLifetime:Number, maxLifetime:Number)
The constructor creates a Lifetime initializer for use by an emitter.
Lifetime
 Inherited
addedToEmitter(emitter:Emitter):void
This method does nothing.
InitializerBase
  
initialize(emitter:Emitter, particle:Particle):void
[override] This method does nothing.
Lifetime
 Inherited
This method does nothing.
InitializerBase
Property Detail
lifetimeproperty
lifetime:Number

When reading, returns the average of minLifetime and maxLifetime. When writing this sets both maxLifetime and minLifetime to the same lifetime value.


Implementation
    public function get lifetime():Number
    public function set lifetime(value:Number):void
maxLifetimeproperty 
maxLifetime:Number

The maximum lifetime for particles initialised by this initializer. Should be between 0 and 1.


Implementation
    public function get maxLifetime():Number
    public function set maxLifetime(value:Number):void
minLifetimeproperty 
minLifetime:Number

The minimum lifetime for particles initialised by this initializer. Should be between 0 and 1.


Implementation
    public function get minLifetime():Number
    public function set minLifetime(value:Number):void
Constructor Detail
Lifetime()Constructor
public function Lifetime(minLifetime:Number, maxLifetime:Number)

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

The lifetime of particles initialized by this class will be a random value between the minimum and maximum values set. If no maximum value is set, the minimum value is used with no variation.

Parameters
minLifetime:Number (default = NaN) — the minimum lifetime for particles initialized by the instance.
 
maxLifetime:Number (default = NaN) — the maximum lifetime for particles initialized by the instance.

See also

Emitter.addInitializer.
Method Detail
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