Modules
Adding Modules
Erizos Studio UI Builder supports creating Modules that help with organizing and structuring the code of the user interface, allowing developers to separate code into different modules, just as you would separate code into separate files, helping to create modularity and maintainability within the code. All UIs in Erizos Studio have one main module named "Script". Developers are able to create additional Modules based on their needs.
To add a module to a UI:
- Click the Stacked Box icon
- Under Modules, click the Create Module Icon .
- Name your Module and click Save.
To access a module function or variable, users need to export the functions or variables to be exposed. To do this, users need to add export
as shown in the example below:
1 2 3 |
|
Accessing Modules
The function of a module can be accessed from other modules via the module name, for example:
MyModule.MyModuleFunction() // where MyModule is the name of the Module and MyModuleFunction is the name of the function