Enumeration InfiniteApiControllerInterfaceSignal

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

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.AboutToRun signal is sent right before the modification of the objects, and InfiniteApiControllerInterfaceSignal.Tick signal is sent at the end of the modification of the objects.

Beware, the InfiniteEngineInterfaceSignal.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 InfiniteApiControllerInterfaceSignal.AboutToRun and InfiniteApiControllerInterfaceSignal.Tick.

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

/** 
* Sample to illustrate the use of signals in the InfiniteApiControllerInterface and InfiniteEngineInterface.
*/
import {
InfiniteApiControllerInterfaceSignal, InfiniteEngineInterface, InfiniteApiControllerInterface,
InfiniteFactory, InfiniteEngineInterfaceSignal
} from 'generated_files/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 for more information.
Events

Enumeration Members

Enumeration Members

AboutToRun: "aboutToRun"

Signal sent by the InfiniteApiControllerInterface when the Infinite objects are about to be updated. This signal is emitted on a regular basis.

No attachment for events of this type.

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.