| Package | org.flintparticles.twoD.emitters |
| Class | public class Emitter2D |
| Inheritance | Emitter2D Emitter flash.events.EventDispatcher |
| Subclasses | Emitter2D |
An emitter uses Initializers to customise the initial state of particles that it creates, their position, velocity, color etc. These are added to the emitter using the addInitializer method.
An emitter uses Actions to customise the behaviour of particles that it creates, to apply gravity, drag, fade etc. These are added to the emitter using the addAction method.
An emitter uses Activities to customise its own behaviour in an ongoing manner, to make it move or rotate.
An emitter uses a Counter to know when and how many particles to emit.
An emitter uses a Renderer to display the particles on screen.
All timings in the emitter are based on actual time passed, not on frames.
Most functionality is best added to an emitter using Actions, Initializers, Activities, Counters and Renderers. This offers greater flexibility to combine behaviours witout needing to subclass the Emitter itself.
The emitter also has position properties - x, y, rotation - that can be used to directly affect its location in the particle system.
| Property | Defined By | ||
|---|---|---|---|
![]() | actions : Vector.<Action>
The array of all actions being used by this emitter. | Emitter | |
![]() | activities : Vector.<Activity>
The array of all actions being used by this emitter. | Emitter | |
![]() | counter : Counter
The Counter for the Emitter. | Emitter | |
| defaultParticleFactory : ParticleFactory [static] [read-only]
The default particle factory used to manage the creation, reuse and destruction of particles. | Emitter2D | ||
![]() | fixedFrameTime : Number
Indicates a fixed time (in seconds) to use for every frame. | Emitter | |
![]() | initializers : Vector.<Initializer>
The array of all initializers being used by this emitter. | Emitter | |
![]() | maximumFrameTime : Number
The maximum duration for a single update frame, in seconds. | Emitter | |
![]() | particleFactory : ParticleFactory
This is the particle factory used by the emitter to create and dispose
of particles. | Emitter | |
![]() | particles : Vector.<Particle>
The collection of all particles being managed by this emitter. | Emitter | |
![]() | particlesArray : Array [read-only]
The actual array of particles used internally by this emitter. | Emitter | |
| rotation : Number
Indicates the rotation of the Emitter, in degrees, within the particle system's coordinate space. | Emitter2D | ||
| rotRadians : Number
Indicates the rotation of the Emitter, in radians, within the particle system's coordinate space. | Emitter2D | ||
![]() | running : Boolean [read-only]
Indicates if the emitter is currently running. | Emitter | |
| spaceSort : Boolean = false
Identifies whether the particles should be arranged
into spacially sorted arrays - this speeds up proximity
testing for those actions that need it. | Emitter2D | ||
![]() | useInternalTick : Boolean
Indicates whether the emitter should manage its own internal update
tick. | Emitter | |
| x : Number
Indicates the x coordinate of the Emitter within the particle system's coordinate space. | Emitter2D | ||
| y : Number
Indicates the y coordinate of the Emitter within the particle system's coordinate space. | Emitter2D | ||
| Method | Defined By | ||
|---|---|---|---|
The constructor creates an emitter. | Emitter2D | ||
![]() |
Adds an Action to the Emitter. | Emitter | |
![]() | addActivity(activity:Activity):void
Adds an Activity to the Emitter. | Emitter | |
![]() | addInitializer(initializer:Initializer):void
Adds an Initializer object to the Emitter. | Emitter | |
![]() | addParticle(particle:Particle, applyInitializers:Boolean = false):void
Add a particle to the emitter. | Emitter | |
![]() | addParticles(particles:Vector.<Particle>, applyInitializers:Boolean = false):void
Adds existing particles to the emitter. | Emitter | |
![]() | dispatchCounterComplete():void
Used by counters to tell the emitter to dispatch a counter complete event. | Emitter | |
![]() |
Detects if the emitter is using a particular action or not. | Emitter | |
![]() | hasActionOfType(actionClass:Class):Boolean
Detects if the emitter is using an action of a particular class. | Emitter | |
![]() | hasActivity(activity:Activity):Boolean
Detects if the emitter is using a particular activity or not. | Emitter | |
![]() | hasActivityOfType(activityClass:Class):Boolean
Detects if the emitter is using an activity of a particular class. | Emitter | |
![]() | hasInitializer(initializer:Initializer):Boolean
Detects if the emitter is using a particular initializer or not. | Emitter | |
![]() | hasInitializerOfType(initializerClass:Class):Boolean
Detects if the emitter is using an initializer of a particular class. | Emitter | |
![]() | killAllParticles():void
Kill all the particles on this emitter. | Emitter | |
![]() | pause():void
Pauses the emitter. | Emitter | |
![]() | removeAction(action:Action):void
Removes an Action from the Emitter. | Emitter | |
![]() | removeActivity(activity:Activity):void
Removes an Activity from the Emitter. | Emitter | |
![]() | removeInitializer(initializer:Initializer):void
Removes an Initializer from the Emitter. | Emitter | |
![]() | removeParticle(particle:Particle):Boolean
Remove a particle from this emitter. | Emitter | |
![]() | removeParticles(particles:Vector.<Particle>):void
Remove a collection of particles from this emitter. | Emitter | |
![]() | resume():void
Resumes the emitter after a pause. | Emitter | |
![]() | runAhead(time:Number, frameRate:Number = 10):void
Makes the emitter skip forwards a period of time with a single update. | Emitter | |
![]() | start():void
Starts the emitter. | Emitter | |
![]() | stop():void
Stops the emitter, killing all current particles and returning them to the
particle factory for reuse. | Emitter | |
![]() | update(time:Number):void
Used to update the emitter. | Emitter | |
| Method | Defined By | ||
|---|---|---|---|
![]() | Emitter | ||
initParticle(particle:Particle):void [override]
Used internally to initialise the position and rotation of a particle relative to the emitter. | Emitter2D | ||
sortParticles():void [override]
Used internally and in derived classes to update the emitter. | Emitter2D | ||
| defaultParticleFactory | property |
defaultParticleFactory:ParticleFactory [read-only] The default particle factory used to manage the creation, reuse and destruction of particles.
public static function get defaultParticleFactory():ParticleFactory| rotation | property |
rotation:NumberIndicates the rotation of the Emitter, in degrees, within the particle system's coordinate space.
public function get rotation():Number public function set rotation(value:Number):void| rotRadians | property |
rotRadians:NumberIndicates the rotation of the Emitter, in radians, within the particle system's coordinate space.
public function get rotRadians():Number public function set rotRadians(value:Number):void| spaceSort | property |
public var spaceSort:Boolean = falseIdentifies whether the particles should be arranged into spacially sorted arrays - this speeds up proximity testing for those actions that need it.
| x | property |
x:NumberIndicates the x coordinate of the Emitter within the particle system's coordinate space.
public function get x():Number public function set x(value:Number):void| y | property |
y:NumberIndicates the y coordinate of the Emitter within the particle system's coordinate space.
public function get y():Number public function set y(value:Number):void| Emitter2D | () | Constructor |
public function Emitter2D()The constructor creates an emitter.
| initParticle | () | method |
override protected function initParticle(particle:Particle):voidUsed internally to initialise the position and rotation of a particle relative to the emitter.
Parameters
particle:Particle |
| sortParticles | () | method |
override protected function sortParticles():voidUsed internally and in derived classes to update the emitter.