Warning

Nightly releases are generated automatically from the latest source code and are intended for experimental purposes only. These builds may contain incomplete or untested features, bugs, or security vulnerabilities, and as such, are not for production use. Users should be aware that nightly releases may cause unexpected behavior, data loss, or system instability. Use of these releases is at the user's own risk, and it is advised to have adequate backups before testing. The software is provided as is with no guarantees or support.

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 );
interface FrameAPI {
    registerFrameListener(listener: FrameListener): void;
    unregisterFrameListener(listener: FrameListener): void;
}

Hierarchy (View Summary)

Methods

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

    Parameters

    Returns void