FrameAPI#

Interface FrameAPI

The FrameAPI provides functionalities to register and unregister custom callback functions which are executed on every run of the ContextAPI internal update loop.

Example

// Create an instance of the ContextAPI
const myContext : ContextAPI = webvis.createContext( "example" )

// Define your frame listener
const myFrameListener : FrameListener = ( time : number, elapsed : number ) =>
{
console.log(`Current time ${time} ms. Time since last call ${elapsed} ms.`);
};

// Register your frame listener
myContext.registerFrameListener( myFrameListener );

// Unregister your frame listener
myContext.registerFrameListener( myFrameListener );

Hierarchy

Methods

  • Registers a listener function which get called once per internal update tick.

    Parameters

    Returns void

  • Unregisters a previously registered listener via registerFrameListener.

    Parameters

    Returns void