Packagecv.orion.output
Classpublic class FunctionOutput
ImplementsIOutput

The FunctionOutput class emits particles based on the given function. This allows you to pulse ouput of particles just by passing in a function that does that. Or if you wanted to create a sine output, create a function that handles that. This class is very flexible if used correctly.


Example
There are two ways to control output. The first way it so set it in the constructor. The second way is to add it via the output property.

To use the FunctionOutput class you must first create a function to be used as a callback. In the following example, that is pulse.

  import cv.Orion;
  import cv.orion.output.FunctionOutput;
  
  // First method
  var e:Orion = new Orion(linkageClass, new FunctionOutput(pulse));
  
  // Second method
  var e2:Orion = new Orion(linkageClass);
  e2.output = new FunctionOutput(pulse);
  
  function pulse(startTime:uint, currentTime:uint):Boolean {
    var modT:uint = (currentTime - startTime) % 1000;
    if(modT < 500) return true;
    return false;
  }
  



Public Properties
 PropertyDefined by
  callback : Function
Gets or sets the function used to control the output.
FunctionOutput
  paused : Boolean
Gets or sets the paused property
FunctionOutput
Public Methods
 MethodDefined by
  
FunctionOutput(callback:Function)
Controls how and when the particles are emitted via the callback function.
FunctionOutput
  
pause():void
Pauses the output class.
FunctionOutput
  
play():void
Resumes or plays the output class.
FunctionOutput
  
update(emitter:Orion):void
This is called everytime the particles are called to update and be redrawn.
FunctionOutput
Property detail
callbackproperty
callback:Function  [read-write]

Gets or sets the function used to control the output.

Implementation
    public function get callback():Function
    public function set callback(value:Function):void
pausedproperty 
paused:Boolean  [read-write]

Gets or sets the paused property

Implementation
    public function get paused():Boolean
    public function set paused(value:Boolean):void
Constructor detail
FunctionOutput()constructor
public function FunctionOutput(callback:Function)

Controls how and when the particles are emitted via the callback function.

Parameters
callback:Function — The function used to determine when to emit particles.
Method detail
pause()method
public function pause():void

Pauses the output class.

play()method 
public function play():void

Resumes or plays the output class.

update()method 
public function update(emitter:Orion):void

This is called everytime the particles are called to update and be redrawn. Depending on the output class, this can determine the output of the particles.

Parameters
emitter:Orion — The emitter to be used.