Packageorg.flintparticles.common.counters
Classpublic class SineCounter
InheritanceSineCounter Inheritance Object
Implements Counter

The Sine counter causes the emitter to emit particles continuously at a rate that varies according to a sine wave.



Public Properties
 PropertyDefined By
  complete : Boolean
[read-only] Indicates if the counter has emitted all its particles.
SineCounter
  period : Number
The period of the sine wave used, in seconds.
SineCounter
  rateMax : Number
The number of particles emitted per second at the peak of the sine wave.
SineCounter
  rateMin : Number
The number of particles to emit per second at the bottom of the sine wave.
SineCounter
  running : Boolean
[read-only] Indicates if the counter is currently emitting particles
SineCounter
Public Methods
 MethodDefined By
  
SineCounter(period:Number = 1, rateMax:Number = 0, rateMin:Number = 0)
The constructor creates a SineCounter counter for use by an emitter.
SineCounter
  
resume():void
Resumes the emitting of particles after a stop
SineCounter
  
startEmitter(emitter:Emitter):uint
Initilizes the counter.
SineCounter
  
stop():void
Stops the emitter from emitting particles
SineCounter
  
updateEmitter(emitter:Emitter, time:Number):uint
Uses the time, period, rateMin and rateMax to calculate how many particles the emitter should emit now.
SineCounter
Property Detail
completeproperty
complete:Boolean  [read-only]

Indicates if the counter has emitted all its particles. For this counter this will always be false.


Implementation
    public function get complete():Boolean
periodproperty 
period:Number

The period of the sine wave used, in seconds.


Implementation
    public function get period():Number
    public function set period(value:Number):void
rateMaxproperty 
rateMax:Number

The number of particles emitted per second at the peak of the sine wave.


Implementation
    public function get rateMax():Number
    public function set rateMax(value:Number):void
rateMinproperty 
rateMin:Number

The number of particles to emit per second at the bottom of the sine wave.


Implementation
    public function get rateMin():Number
    public function set rateMin(value:Number):void
runningproperty 
running:Boolean  [read-only]

Indicates if the counter is currently emitting particles


Implementation
    public function get running():Boolean
Constructor Detail
SineCounter()Constructor
public function SineCounter(period:Number = 1, rateMax:Number = 0, rateMin:Number = 0)

The constructor creates a SineCounter counter for use by an emitter. To add a SineCounter counter to an emitter use the emitter's counter property.

Parameters
period:Number (default = 1) — The number of particles emitted per second at the peak of the sine wave.
 
rateMax:Number (default = 0) — The number of particles to emit per second at the bottom of the sine wave.
 
rateMin:Number (default = 0)

See also

org.flintparticles.common.emitter.Emitter.counter
Method Detail
resume()method
public function resume():void

Resumes the emitting of particles after a stop

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

Initilizes the counter. Returns 0 to indicate that the emitter should emit no particles when it 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 — 0

See also

stop()method 
public function stop():void

Stops the emitter from emitting particles

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

Uses the time, period, rateMin and rateMax to calculate how many particles the emitter should emit now.

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 create.

See also