Constructor. Use context.enableWrenSupport() instead.
Add a dynamic reloadable .wren source file. The module is reloaded and compared when reloadScriptsThatChanged() is called. Development purpose. For a release plug-in, you want to use addModuleSource instead.
Add a read-only Wren module source code, to be loaded once and never changed. Release purpose. When in developement, you might prefer a reloadable file, with addModuleFileWatch.
To call in your UI's constructor. This call the Plugin.createUI Wren method, in module "plugin".
Call Plugin.<methodName>, a static method without arguments in Wren. For advanced users only.
To call in your UI's reflow() method. This call the Plugin.reflow Wren method, in module "plugin".
Call this in your onAnimate callback. This polls script regularly and force a full redraw.
Interpret arbitrary code. For advanced users only.
Interpret arbitrary code. For advanced users only.
Instantiate that with your main UI widget to register widgets classes. Foreach member variable of GUIClass with the @ScriptExport attribute, this registers a Wren class The right Wren class can then be returned by the $ operator and UI.getElementById methods.
Add a UIElement derivative class into the set of known classes in Wren, and all its parent up to UIElement It is recommended that you use @ScriptExport on your fields and registerScriptExports instead, but this can be used to register classes manually.
Read live-reload .wren files and restart the Wren VM if they have changed. Check the registered .wren file and check if they have changed. Since it (re)starts the Wren VM, it cannot be called from Wren.
// Inside your UI constructor mixin(fieldIdentifiersAreIDs!DistortGUI); context.enableWrenSupport(); debug context.wrenSupport.addModuleFileWatch("plugin", `/absolute/path/to/my/plugin.wren`); // Live-reload else context.wrenSupport.addModuleSource("plugin", import("plugin.wren")); // Final release has static scripts context.wrenSupport.registerScriptExports!DistortGUI; context.wrenSupport.callCreateUI(); // Inside your UI destructor context.disableWrenSupport();
enableWrenSupport(), disableWrenSupport()
WrenSupport manages interaction between Wren and the plugin. Such an object is created/destroyed/accessed with enableWrenSupport(), disableWrenSupport(), and wrenSupport(). It is held, as all GUI globals in the UIContext.