| Package | idv.cjcat.stardust.common.emitters |
| Class | public class Emitter |
| Inheritance | Emitter StardustElement |
| Implements | ActionCollector, InitializerCollector |
| Subclasses | Emitter2D, Emitter3D |
| Property | Defined 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 | ||
![]() | name : 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 | ||
| Method | Defined by | ||
|---|---|---|---|
|
Emitter(clock:Clock = null, particleHandler:ParticleHandler = null, particlesCollectionType:int = 0)
| Emitter | ||
|
Adds an action to the emitter.
| Emitter | ||
|
addInitializer(initializer:Initializer):void
Adds an initializer to the emitter.
| Emitter | ||
|
addParticles(particles:ParticleCollection):void
This method is used to manually add existing particles to the emitter's simulation.
| Emitter | ||
|
clearActions():void
Removes all actions from the emitter.
| Emitter | ||
|
clearInitializers():void
Removes all initializers from the emitter.
| Emitter | ||
|
clearParticles():void
Clears all particles from the emitter's simulation.
| Emitter | ||
|
getElementTypeXMLTag():XML
| Emitter | ||
|
getRelatedObjects():Array
| Emitter | ||
![]() |
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 | ||
| active | property |
public var active:BooleanWhether 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.
| clock | property |
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
| numParticles | property |
numParticles:int [read-only]The number of particles in the emitter.
Implementation public function get numParticles():int
| onEmpty | property |
onEmpty:ISignal [read-only]Dispatched when the emitter is empty of particles.
Signature: (emitter:Emitter) Implementation public function get onEmpty():ISignal
| onStepBegin | property |
onStepBegin:ISignal [read-only]Dispatched at the beginning of each step.
Signature: (emitter:Emitter, particles:ParticleCollection, time:Number) Implementation public function get onStepBegin():ISignal
| onStepEnd | property |
onStepEnd:ISignal [read-only]Dispatched at the end of each step.
Signature: (emitter:Emitter, particles:ParticleCollection, time:Number) Implementation public function get onStepEnd():ISignal
| particleCollectionType | property |
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.
public function get particleCollectionType():int
public function set particleCollectionType(value:int):void
See also
| particleHandler | property |
particleHandler:ParticleHandler [read-write]Implementation
public function get particleHandler():ParticleHandler
public function set particleHandler(value:ParticleHandler):void
| particles | property |
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
| 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) |
| addAction | () | method |
public function addAction(action:Action):voidAdds an action to the emitter.
Parametersaction:Action |
| addInitializer | () | method |
public function addInitializer(initializer:Initializer):voidAdds an initializer to the emitter.
Parametersinitializer:Initializer |
| addParticles | () | method |
public final function addParticles(particles:ParticleCollection):voidThis method is used to manually add existing particles to the emitter's simulation.
You should use the particleFactory class to manually create particles.
particles:ParticleCollection |
| clearActions | () | method |
public final function clearActions():voidRemoves all actions from the emitter.
| clearInitializers | () | method |
public final function clearInitializers():voidRemoves all initializers from the emitter.
| clearParticles | () | method |
public final function clearParticles():voidClears 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):voidRemoves an action from the emitter.
Parametersaction:Action |
| removeInitializer | () | method |
public final function removeInitializer(initializer:Initializer):voidRemoves an initializer form the emitter.
Parametersinitializer:Initializer |
| step | () | method |
public final function step(time:Number = 1):voidThis 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.
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 |