Packageidv.cjcat.stardust.common.actions
Classpublic class Action
InheritanceAction Inheritance StardustElement
SubclassesAction2D, Action3D, Age, AlphaCurve, CompositeAction, DeathLife, Die, ScaleCurve

An action is used to continuously update a particle's property.

An action is associated with an emitter. On each Emitter.step() method call, the action's update() method is called with each particles in the emitter passed in as parameter. This method updates a particles property, such as changing the particle's position according to its velocity, or modifying the particle's velocity based on gravity fields.

Default priority = 0;



Public Properties
 PropertyDefined by
  active : Boolean
Denotes if the action is active, true by default.
Action
  mask : int
The action will affect a particle only if it's active and the bitwise AND of the action's mask and the particle's mask is non-zero, 1 by default.
Action
 Inheritedname : String
StardustElement
  needsSortedParticles : Boolean
[read-only] Tells the emitter whether this action requires that particles must be sorted before the update() calls.
Action
  onAdd : ISignal
[read-only] Dispatched when the added to an emitter.
Action
  onPriorityChange : ISignal
[read-only] Dispatched when the action's priority is changed.
Action
  onRemove : ISignal
[read-only] Dispatched when the removed from an emitter.
Action
  priority : int
Actions will be sorted by the associated emitter according to their priorities.
Action
  skipThisAction : Boolean
Reset to false on each emitter step.
Action
  supports2D : Boolean
[read-only] Whether this action supports 2D.
Action
  supports3D : Boolean
[read-only] Whether this action supports 3D.
Action
Public Methods
 MethodDefined by
  
Action
  
Action
 Inherited
[Abstract Method] Returns the related objects of the element.
StardustElement
 Inherited
getXMLTag():XML
Returns the root tag of the XML representation.
StardustElement
  
getXMLTagName():String
Action
  
parseXML(xml:XML, builder:XMLBuilder = null):void
Action
  
postUpdate(emitter:Emitter, time:Number):void
[Template Method] This method is called once after each Emitter.step() method call, after the update() calls with each particles in the emitter.
Action
  
toXML():XML
Action
  
update(emitter:Emitter, particle:Particle, time:Number):void
[Template Method] Acts on all particles upon each Emitter.step() method call.
Action
Property detail
activeproperty
public var active:Boolean

Denotes if the action is active, true by default.

maskproperty 
mask:int  [read-write]

The action will affect a particle only if it's active and the bitwise AND of the action's mask and the particle's mask is non-zero, 1 by default.

This can be used to mask out specific particles that you do not wish to be affected by an action.

Implementation
    public function get mask():int
    public function set mask(value:int):void
needsSortedParticlesproperty 
needsSortedParticles:Boolean  [read-only]

Tells the emitter whether this action requires that particles must be sorted before the update() calls.

For instance, the Collide action needs all particles to be sorted in X positions.

Implementation
    public function get needsSortedParticles():Boolean
onAddproperty 
onAdd:ISignal  [read-only]

Dispatched when the added to an emitter.

Signature: (emitter:Emitter, action:Action)

Implementation
    public function get onAdd():ISignal
onPriorityChangeproperty 
onPriorityChange:ISignal  [read-only]

Dispatched when the action's priority is changed.

Signature: (action:Action)

Implementation
    public function get onPriorityChange():ISignal
onRemoveproperty 
onRemove:ISignal  [read-only]

Dispatched when the removed from an emitter.

Signature: (emitter:Emitter, action:Action)

Implementation
    public function get onRemove():ISignal
priorityproperty 
priority:int  [read-write]

Actions will be sorted by the associated emitter according to their priorities.

This is important, since it doesn't make sense to first update a particle's position according to its speed, and then update the velocity according to gravity fields afterwards. You can alter the priority of an action, but it is recommended that you use the default values.

Implementation
    public function get priority():int
    public function set priority(value:int):void
skipThisActionproperty 
public var skipThisAction:Boolean

Reset to false on each emitter step. If set to true in a update() method call, this action is skipped by the emitter during that emitter step.

supports2Dproperty 
supports2D:Boolean  [read-only]

Whether this action supports 2D.

Implementation
    public function get supports2D():Boolean
supports3Dproperty 
supports3D:Boolean  [read-only]

Whether this action supports 3D.

Implementation
    public function get supports3D():Boolean
Constructor detail
Action()constructor
public function Action()
Method detail
getElementTypeXMLTag()method
public override function getElementTypeXMLTag():XML

Returns
XML
getXMLTagName()method 
public override function getXMLTagName():String

Returns
String
parseXML()method 
public override function parseXML(xml:XML, builder:XMLBuilder = null):voidParameters
xml:XML
 
builder:XMLBuilder (default = null)
postUpdate()method 
public function postUpdate(emitter:Emitter, time:Number):void

[Template Method] This method is called once after each Emitter.step() method call, after the update() calls with each particles in the emitter.

All setup operatoins before the update() calls should be done here.

Parameters
emitter:Emitter — The associated emitter.
 
time:Number — The timespan of each emitter's step.
toXML()method 
public override function toXML():XML

Returns
XML
update()method 
public function update(emitter:Emitter, particle:Particle, time:Number):void

[Template Method] Acts on all particles upon each Emitter.step() method call.

Override this method to create custom actions.

Parameters
emitter:Emitter — The associated emitter.
 
particle:Particle — The associated particle.
 
time:Number — The timespan of each emitter's step.