Packageidv.cjcat.stardust.common.emitters
Classpublic class Emitter
InheritanceEmitter Inheritance StardustElement
ImplementsActionCollector, InitializerCollector
SubclassesEmitter2D, Emitter3D

This class takes charge of the actual particle simulation of the Stardust particle system.



Public Properties
 PropertyDefined by
  active : Boolean
Whether the emitter is active, true by default.
Emitter
  clock : Clock
The clock determines how many particles the emitter creates in each step.
Emitter
 Inheritedname : String
StardustElement
  numParticles : int
[read-only] The number of particles in the emitter.
Emitter
  onEmpty : ISignal
[read-only] Dispatched when the emitter is empty of particles.
Emitter
  onStepBegin : ISignal
[read-only] Dispatched at the beginning of each step.
Emitter
  onStepEnd : ISignal
[read-only] Dispatched at the end of each step.
Emitter
  particleCollectionType : int
Determines the collection used internally by the emitter.
Emitter
  particleHandler : ParticleHandler
Emitter
  particles : ParticleCollection
[read-only] Returns an array of particles for custom parameter manipulation.
Emitter
Public Methods
 MethodDefined by
  
Emitter(clock:Clock = null, particleHandler:ParticleHandler = null, particlesCollectionType:int = 0)
Emitter
  
addAction(action:Action):void
Adds an action to the emitter.
Emitter
  
addInitializer(initializer:Initializer):void
Adds an initializer to the emitter.
Emitter
  
This method is used to manually add existing particles to the emitter's simulation.
Emitter
  
clearActions():void
Removes all actions from the emitter.
Emitter
  
Removes all initializers from the emitter.
Emitter
  
Clears all particles from the emitter's simulation.
Emitter
  
Emitter
  
Emitter
 Inherited
getXMLTag():XML
Returns the root tag of the XML representation.
StardustElement
  
getXMLTagName():String
Emitter
  
parseXML(xml:XML, builder:XMLBuilder = null):void
Emitter
  
removeAction(action:Action):void
Removes an action from the emitter.
Emitter
  
removeInitializer(initializer:Initializer):void
Removes an initializer form the emitter.
Emitter
  
step(time:Number = 1):void
This method is the main simulation loop of the emitter.
Emitter
  
toXML():XML
Emitter
Property detail
activeproperty
public var active:Boolean

Whether the emitter is active, true by default.

If the emitter is active, it creates particles in each step according to its clock. Note that even if an emitter is not active, the simulation of existing particles still goes on in each step.

clockproperty 
clock:Clock  [read-write]

The clock determines how many particles the emitter creates in each step.

Implementation
    public function get clock():Clock
    public function set clock(value:Clock):void
numParticlesproperty 
numParticles:int  [read-only]

The number of particles in the emitter.

Implementation
    public function get numParticles():int
onEmptyproperty 
onEmpty:ISignal  [read-only]

Dispatched when the emitter is empty of particles.

Signature: (emitter:Emitter)

Implementation
    public function get onEmpty():ISignal
onStepBeginproperty 
onStepBegin:ISignal  [read-only]

Dispatched at the beginning of each step.

Signature: (emitter:Emitter, particles:ParticleCollection, time:Number)

Implementation
    public function get onStepBegin():ISignal
onStepEndproperty 
onStepEnd:ISignal  [read-only]

Dispatched at the end of each step.

Signature: (emitter:Emitter, particles:ParticleCollection, time:Number)

Implementation
    public function get onStepEnd():ISignal
particleCollectionTypeproperty 
particleCollectionType:int  [read-write]

Determines the collection used internally by the emitter. There are two options: linked-lists and arrays. Linked-Lists are generally faster to iterate through and remove particles from, while arrays are faster at sorting. By default, linked-lists are used. Switch to arrays if the particles need to be sorted.

There are two possible values that can assigned to this property: ParticleCollectionType.LINKED_LIST and ParticleCollectionType.ARRAY.

Implementation
    public function get particleCollectionType():int
    public function set particleCollectionType(value:int):void

See also

particleHandlerproperty 
particleHandler:ParticleHandler  [read-write]Implementation
    public function get particleHandler():ParticleHandler
    public function set particleHandler(value:ParticleHandler):void
particlesproperty 
particles:ParticleCollection  [read-only]

Returns an array of particles for custom parameter manipulation. Note that the returned array is merely a copy of the internal particle array, so splicing particles out from this array does not remove the particles from simulation.

Implementation
    public function get particles():ParticleCollection
Constructor detail
Emitter()constructor
public function Emitter(clock:Clock = null, particleHandler:ParticleHandler = null, particlesCollectionType:int = 0)Parameters
clock:Clock (default = null)
 
particleHandler:ParticleHandler (default = null)
 
particlesCollectionType:int (default = 0)
Method detail
addAction()method
public function addAction(action:Action):void

Adds an action to the emitter.

Parameters
action:Action
addInitializer()method 
public function addInitializer(initializer:Initializer):void

Adds an initializer to the emitter.

Parameters
initializer:Initializer
addParticles()method 
public final function addParticles(particles:ParticleCollection):void

This method is used to manually add existing particles to the emitter's simulation.

You should use the particleFactory class to manually create particles.

Parameters
particles:ParticleCollection
clearActions()method 
public final function clearActions():void

Removes all actions from the emitter.

clearInitializers()method 
public final function clearInitializers():void

Removes all initializers from the emitter.

clearParticles()method 
public final function clearParticles():void

Clears all particles from the emitter's simulation.

getElementTypeXMLTag()method 
public override function getElementTypeXMLTag():XML

Returns
XML
getRelatedObjects()method 
public override function getRelatedObjects():Array

Returns
Array
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)
removeAction()method 
public final function removeAction(action:Action):void

Removes an action from the emitter.

Parameters
action:Action
removeInitializer()method 
public final function removeInitializer(initializer:Initializer):void

Removes an initializer form the emitter.

Parameters
initializer:Initializer
step()method 
public final function step(time:Number = 1):void

This method is the main simulation loop of the emitter.

In order to keep the simulation go on, this method should be called continuously. It is recommended that you call this method through the Event.ENTER_FRAME event or the TimerEvent.TIMER event.

Parameters
time:Number (default = 1) — The time interval of a single step of simulation. For instance, doubling this parameter causes the simulation to go twice as fast.
toXML()method 
public override function toXML():XML

Returns
XML