Introduction to UI Scripting

July 4, 2022

Introduction to UI Scripting

Currently, the interface editor can only layout the interface and set the properties of the controls. If you want to realize the interaction logic between the UI and the game, you need to write a lua script for the interface.

When creating a new interface file,It will automatically create a new lua script file with the same name for the interface. The logic related to this interface can be written in this script,This script is automatically executed when the interface is created in the game.

existControl Hierarchy Management PanelYou can find the script editing button in the property panel by selecting any control in the menu. Click the button to open the lua script of the same name corresponding to the interface.

For specific UI related APIs, please refer to API Manual