| Package | org.flintparticles.common.actions |
| Class | public class ChangeMass |
| Inheritance | ChangeMass ActionBase |
Usually a particle's energy changes from 1 to 0 over its lifetime, but this can be altered via the easing function set within the age action.
This action should be used in conjunction with the Age action.
See also
| Property | Defined by | ||
|---|---|---|---|
| endMass : Number
The mass for the particle when its energy
is 0 - usually at the end of its lifetime.
| ChangeMass | ||
| startMass : Number
The mass for the particle when its energy
is 1 - usually at the start of its lifetime.
| ChangeMass | ||
| Method | Defined by | ||
|---|---|---|---|
|
ChangeMass(startMass:Number = 1, endMass:Number = 1)
The constructor creates a ChangeMass action for use by an emitter.
| ChangeMass | ||
![]() |
addedToEmitter(emitter:Emitter):void
This method does nothing.
| ActionBase | |
![]() |
getDefaultPriority():Number
Returns a default priority of 0 for this action.
| ActionBase | |
![]() |
removedFromEmitter(emitter:Emitter):void
This method does nothing.
| ActionBase | |
|
Sets the mass of the particle based on the values defined
and the particle's energy level.
| ChangeMass | ||
| endMass | property |
endMass:Number [read-write]The mass for the particle when its energy is 0 - usually at the end of its lifetime.
Implementation public function get endMass():Number
public function set endMass(value:Number):void
| startMass | property |
startMass:Number [read-write]The mass for the particle when its energy is 1 - usually at the start of its lifetime.
Implementation public function get startMass():Number
public function set startMass(value:Number):void
| ChangeMass | () | constructor |
public function ChangeMass(startMass:Number = 1, endMass:Number = 1)The constructor creates a ChangeMass action for use by an emitter. To add a Mass to all particles created by an emitter, use the emitter's addAction method.
ParametersstartMass:Number (default = 1) — The mass for the particle when its energy
is 1 - usually at the start of its lifetime.
|
|
endMass:Number (default = 1) — The mass for the particle when its energy
is 0 - usually at the end of its lifetime.
|
See also
| update | () | method |
public override function update(emitter:Emitter, particle:Particle, time:Number):voidSets the mass of the particle based on the values defined and the particle's energy level.
This method is called by the emitter and need not be called by the user
Parametersemitter: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