Skip to content

UI builder - Studio API

Engine

To execute Engine APIs, take a look at the examples below:

Examples:

Api.engine("My Engine").cache("My Asset");
Api.engine("My Engine").clear();

Every function on this page is asynchronous and returns a Promise.

sendCommand

Send Command to the Engine

Api.engine("My Engine").sendCommand(command: object | string): Promise<any>;

Parameter Type Description
command object/string The command to be sent to the Engine

clear

Clear the Engine

Api.engine("My Engine").clear(layer?: string): Promise<any>;

Parameter Type Description
layer string The Layer to be cleared

cleanup

Cleanup the Engine

Api.engine("My Engine").cleanup(layer?: string): Promise<any>;

Parameter Type Description
layer string The Layer to be cleaned up

Unlike the Profile API's cleanup, this one accepts a layer.

cache

Cache the Asset/Assets in the path

Api.engine("My Engine").cache(assets: string | string[], verify?: boolean): Promise<any>;
Parameter Type Description
assets string/string[ ] The Asset/Assets to be cached
verify boolean Verify the assets are cached rather than assuming

setGroupState

Set internal transition logic state

Api.engine("My Engine").setGroupState(template: string, group: string, state?: string): Promise<any>;
Parameter Type Description
template string The template the group is in
group string The group whose state to set
state string The state to set

Api.engines

Api.engines is a read-only array of every engine. Each entry is an engine target like the one Api.engine(...) returns, with two extra read-only properties:

Property Type Description
_id string The engine's id
system string The renderer the engine runs
Api.engines[0].clear();

See Classes for the full type.