Reference
Last updated
Last updated
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:
The widget object has the following properties:
Name | Type | Example | Description |
---|---|---|---|
The widget object has the following methods:
Returns a Singular timer control object.
Use createTimeControl()
to manage timers and synchronize them globally in all composition and output instances.
none
object
: Time control object
Initializes and registers callback functions.
The init()
function defines callback functions for events in a JSON object.
none
Creates an instance of a composition and initializes it. This function is only required when a widget supports widget compositions.
object
: Composition Instance
Sends a custom message to the composition script. Registers a message listener in composition script to receive and process the message object.
none
Method | Return type | Description |
---|---|---|
Event | Description |
---|---|
Name | Type | Description |
---|---|---|
Name | Type | 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.
Object
Creates a Singular timer object.
-
Registers callback functions for onInit
, onValue
, onButtonClicked
, onEditComp
, and onAnimation
events.
-
Creates an instantiate of a widget composition.
-
Sends a custom message to a composition script.
onInit
Called when loading a composition, adding a widget, or closing a widget composition.
onValue
Called when changing a value in a widget UI field.
onButtonClicked
Called when clicking a button in a widget UI.
onEditComp
Called when starting to edit a widget composition. Creates and initializes widget nodes in this callback.
onAnimation
Called when a widget supports custom widget animations and a user selected using the widget animation in the animation timeline.
compositionID
string
A Composition ID returned by the onValue() function.
domElement
html
An HTML dom element.
cb
function
The callback function.
message
string, number, object
A message object.