Reference
The reference documentation provided in the following sections describes the Widget SDK structure and methods, and the widget UI definition.
The Widget SDK returns an object with the following properties and methods:
Properties
The widget object has the following properties:
Name | Type | Example | Description |
---|---|---|---|
compositionId | String | "-NIqFVJ1rRnNsiUQJing" | The ID of a (sub)composition. |
instanceId | String | The ID of a widget composition instance. | |
widgetId | Number | 4215 | The ID of a widget template. |
widgetVersion | Number | 1 | The version of a widget. |
Methods
The widget object has the following methods:
Method | Return type | Description |
---|---|---|
Object | Creates a Singular timer object. | |
- | Registers callback functions for | |
- | Creates an instantiate of a widget composition. | |
- | Sends a custom message to a composition script. |
createTimeControl()
Returns a Singular timer control object.
Use createTimeControl()
to manage timers and synchronize them globally in all composition and output instances.
Parameter
none
Return
object
: Time control object
See also
init()
Initializes and registers callback functions.
Parameter
The init()
function defines callback functions for events in a JSON object.
Event | Description |
---|---|
| Called when loading a composition, adding a widget, or closing a widget composition. |
| Called when changing a value in a widget UI field. |
| Called when clicking a button in a widget UI. |
| Called when starting to edit a widget composition. Creates and initializes widget nodes in this callback. |
| Called when a widget supports custom widget animations and a user selected using the widget animation in the animation timeline. |
Also see
Return
none
instantiate()
Creates an instance of a composition and initializes it. This function is only required when a widget supports widget compositions.
Parameter
Name | Type | Description |
---|---|---|
compositionID | string | A Composition ID returned by the onValue() function. |
domElement | html | An HTML dom element. |
cb | function | The callback function. |
Return
object
: Composition Instance
See also
sendCustomMessage()
Sends a custom message to the composition script. Registers a message listener in composition script to receive and process the message object.
Parameter
Name | Type | Description |
---|---|---|
message | string, number, object | A message object. |
Return
none
Last updated