Enumeration InfiniteApiControllerInterfaceSignal

The InfiniteApiControllerInterfaceSignal lists all the signals that may be sent by the InfiniteApiControllerInterface.

This signal is emitted by the InfiniteApiControllerInterface when the following occurs. The 3djuump infinite API features an internal clock that sets the pace of the whole API : objects are updated at fixed intervals (all at once). The InfiniteApiControllerInterfaceSignal.Tick signal is sent at the end of the modification of the objects.

Beware, the DisplayDone signal is not sent just after the update of the objects, but when the image content is displayed on the view (window.requestAnimationFrame).

If you want to synchronize a behavior when the objects are updated, then use Tick.

If you want to synchronize a behavior when the display is updated, then use DisplayDone.

/** 
* Sample to illustrate the use of signals in the InfiniteApiControllerInterface and InfiniteEngineInterface.
*/
import { InfiniteApiControllerInterfaceSignal, InfiniteEngineInterface, InfiniteApiControllerInterface, InfiniteFactory, InfiniteEngineInterfaceSignal } from 'generated/documentation/appinfiniteapi';

// what to do when the display is updated ?
const onDisplayUpdated = () : void =>
{
console.log('display has just been updated');
}

// what to do when the objects are updated ?
const onObjectUpdated = () : void =>
{
console.log('infinite objects have just been updated');
}

// the InfiniteEngineInterface has been created previously
let lInfiniteEngine : InfiniteEngineInterface;

// the api controller interface (no need to create it, it is available !)
const lControllerInterface : InfiniteApiControllerInterface = InfiniteFactory.GetInfiniteApiController();

// register callbacks on Tick and DisplayDone
lControllerInterface.addEventListener(InfiniteApiControllerInterfaceSignal.Tick, onObjectUpdated);
lInfiniteEngine.addEventListener(InfiniteEngineInterfaceSignal.DisplayDone, onDisplayUpdated);

Please refer to [InfiniteApiControllerInterface](../interfaces/InfiniteApiControllerInterface.html) for more information.
Main

See

Enumeration Members

Enumeration Members

Tick: "tick"

Signal sent by the InfiniteApiControllerInterface when the infinite objects have finished being updated. This signal is emitted on a regular basis.

No attachment for events of this type.