Define Interface Functions and Events in Composites
As a composite creator, you can define interface functions and events to add custom logic and let story developers add scripts to your composite.
Define an Interface Function
You can define an interface function, so that story developers can use it in stories.
To add a script function, in the Interface section of Outline, select (Add Script Function) to the right of Functions. Then, configure the script function in the panel, and edit scripts by selecting to the right of the function.
For how to create a function, you can refer to Use Script Objects.
The interface function names should be other than the existing composite related function names, for example, fireEvent.
Define an Interface Event
You can define a script event for your composite, so that in stories story developers can write scripts for the composite.
To add a script event, in the Interface section of Outline, select (Add Script Event) to the right of Events. You can enter a name for the event.
In stories, the event'll be displayed when story developers select (Edit Scripts) to the right of the composite in Outline.
Composite.fireEvent(eventName: string): void;
In addition, in the Scripting section of Outline, you can add script variables and script objects, which can be reused in scripting in the composite. You can also add scripts to the widgets in the composite. With scripts available, the composite itself has customized interactions and custom logic.