| Package | idv.cjcat.stardust.common.actions |
| Class | public class Action |
| Inheritance | Action StardustElement |
| Subclasses | Action2D, Action3D, Age, AlphaCurve, CompositeAction, DeathLife, Die, ScaleCurve |
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;
| Property | Defined 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 | ||
![]() | name : 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 | ||
| Method | Defined by | ||
|---|---|---|---|
|
Action()
| Action | ||
|
getElementTypeXMLTag():XML
| Action | ||
![]() |
getRelatedObjects():Array
[Abstract Method] Returns the related objects of the element.
| StardustElement | |
![]() |
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 | ||
|
[Template Method] Acts on all particles upon each
Emitter.step() method call. | Action | ||
| active | property |
public var active:BooleanDenotes if the action is active, true by default.
| mask | property |
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
| needsSortedParticles | property |
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.
public function get needsSortedParticles():Boolean
| onAdd | property |
onAdd:ISignal [read-only]Dispatched when the added to an emitter.
Signature: (emitter:Emitter, action:Action) Implementation public function get onAdd():ISignal
| onPriorityChange | property |
onPriorityChange:ISignal [read-only]Dispatched when the action's priority is changed.
Signature: (action:Action) Implementation public function get onPriorityChange():ISignal
| onRemove | property |
onRemove:ISignal [read-only]Dispatched when the removed from an emitter.
Signature: (emitter:Emitter, action:Action) Implementation public function get onRemove():ISignal
| priority | property |
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
| skipThisAction | property |
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.
| supports2D | property |
supports2D:Boolean [read-only]Whether this action supports 2D.
Implementation public function get supports2D():Boolean
| supports3D | property |
supports3D:Boolean [read-only]Whether this action supports 3D.
Implementation public function get supports3D():Boolean
| Action | () | constructor |
public function Action()
| 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.
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.
Parametersemitter:Emitter — The associated emitter.
|
|
particle:Particle — The associated particle.
|
|
time:Number — The timespan of each emitter's step.
|