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

NameTypeOptionalDefaultDescripton
nFpsNumbercheckedBiFpsGenerator.DEFAULT_FRAME_RATE Frame rate / Frames Per Second

Properties

NameTypegetsetDescripton
currentFrameNumbercheckedReturns current frame.
frameRatevoidcheckedcheckedSets the frame rate.

Methods

NameDescription
disposePlease call when you are finished using this object.
isGlobalGeneratorDetermines wether this is the globalGenerator or not.
startStarts generating events.
stopStop generating events.

Events

NameTypeBubblesDescripton
frameprogressionBiFrameProgressionEventFired upon every new frame

Static Methods

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

Static Fields

NameTypeDescripton
DEFAULT_FRAME_RATENumberGood frame rate for most systems. Also used by the global generator.
globalInstanceBiFpsGeneratorThe static global instance that can be used by multiple animations.

Remarks

None.

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

Stop 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

NameTypeOptionalDefaultDescripton
nFpsNumbercheckedBiFpsGenerator.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