Packageorg.flintparticles.common.counters
Interfacepublic interface Counter
Implementors Blast, KeyDownCounter, PerformanceAdjusted, Pulse, Random, SineCounter, Steady, TimePeriod, ZeroCounter

The Counter interface must be implemented by all counters.

A counter is a class that tells an emitter how many particles to emit at any time. The two methods control the rate of emission of particles when the emitter starts and every frame thereafter.

A counter is directly associated with an emitter. A counter is set for an emitter by assigning it to the emitter's counter property.

See also

org.flintparticles.common.emitters.Emitter.counter


Public Properties
 PropertyDefined By
  complete : Boolean
[read-only] Indicates if the counter has emitted all its particles
Counter
  running : Boolean
[read-only] Indicates if the counter is currently emitting particles
Counter
Public Methods
 MethodDefined By
  
resume():void
Resumes the counter after a stop
Counter
  
startEmitter(emitter:Emitter):uint
The startEmitter method is called when the emitter starts.
Counter
  
stop():void
Stops the counter instructing the emitter to emit particles
Counter
  
updateEmitter(emitter:Emitter, time:Number):uint
The updateEmitter method is called every frame after the emitter has started.
Counter
Property Detail
completeproperty
complete:Boolean  [read-only]

Indicates if the counter has emitted all its particles


Implementation
    public function get complete():Boolean
runningproperty 
running:Boolean  [read-only]

Indicates if the counter is currently emitting particles


Implementation
    public function get running():Boolean
Method Detail
resume()method
public function resume():void

Resumes the counter after a stop

startEmitter()method 
public function startEmitter(emitter:Emitter):uint

The startEmitter method is called when the emitter starts.

This method is called within the emitter's start method and need not be called by the user.

Parameters

emitter:Emitter — The emitter.

Returns
uint — The number of particles the emitter should emit when it starts.
stop()method 
public function stop():void

Stops the counter instructing the emitter to emit particles

updateEmitter()method 
public function updateEmitter(emitter:Emitter, time:Number):uint

The updateEmitter method is called every frame after the emitter has started.

This method is called within the emitter's update loop and need not be called by the user.

Parameters

emitter:Emitter — The emitter
 
time:Number — The time, in seconds, since the previous call to this method.

Returns
uint — The number of particles the emitter should emit at this time.