BiFpsGenerator

Frame generation engine, used for animation.
Each animation can have it's own BiFpsGenerator or it can use the global BiFpsGenerator. Different animations can share the global generator, which saves system resources. Use the factory method, instead of the constructor, to get the global generator. The frame generator generates FrameProgressionEvents a certain number of times per second, as specified by the framerate.

This class extends BiEventTarget and therefore all methods and fields available for BiEventTarget are also available for BiFpsGenerator .

Constructor

new BiFpsGenerator ( [ nFps ] )

Parameters

Name Type Optional Default Descripton
nFps Number checked BiFpsGenerator.DEFAULT_FRAME_RATE Frame rate / Frames Per Second

Properties

Name Type get set Descripton
currentFrame Number checked Returns current frame.
frameRate Number checked checked Sets the frame rate.

Methods

Name Description
dispose Please call when you are finished using this object.
isGlobalGenerator Determines wether this is the globalGenerator or not.
start Starts generating events.
stop Pause generating events.

Events

Name Type Bubbles Descripton
frameprogression BiFrameProgressionEvent Fired upon every new frame

Static Methods

Name Description
create Factory method that returns a global FPSGenerator, shared by all users, or a new unique generator.

Static Fields

Name Type Descripton
DEFAULT_FRAME_RATE Number Good frame rate for most systems. Also used by the global generator.
globalInstance BiFpsGenerator The static global instance that can be used by multiple animations.

Remarks

Method Details

dispose

Please call when you are finished using this object.

Syntax

object.dispose
 (
 
 )
 

Parameters

No arguments.

Return Type

void

isGlobalGenerator

Determines wether this is the globalGenerator or not.

Syntax

object.isGlobalGenerator
 (
 
 )
 

Parameters

No arguments.

Return Type

boolean

start

Starts generating events.

Syntax

object.start
 (
 
 )
 

Parameters

No arguments.

Return Type

void

stop

Pause generating events.

Syntax

object.stop
 (
 
 )
 

Parameters

No arguments.

Return Type

void

Static Method Details

create

Factory method that returns a global FPSGenerator, shared by all users, or a new unique generator.

Syntax

BiFpsGenerator
 .
 create
 (
 
 [
 nFps
 ]
 
 )
 

Parameters

Name Type Optional Default Descripton
nFps Number checked BiFpsGenerator.DEFAULT_FRAME_RATE Frames Per Second.
If you don't supply this value or if it equals DEFAULT_FRAME_RATE it returns the global generator.

Return Type

BiFpsGenerator