Skip to main content

UI Editor

Overview

The UI Editor includes two parts, UI Designer and UI Animation Designer.

UI Designer: UI design refers to the overall design of the software, which includes human-computer interaction, operation logic and aesthetics of interface.

UI Animation Designer: Handle the motion curve, motion speed, etc. of animations to make the transition of the control more logical to reality.

Opening the UI Editor

Opening the Editor

image-20220930170316928

Creating New UI Asset Files

In the blank area of the Resource Preview window, right-click to bring up a menu option and select UI File to create a new UI asset file.

image-20220930102528824

image-20220930102656746

Starting UI Editing Interface

Double-click the newly created UI asset file in the Resource Preview window to bring up the UI editing interface, which is displayed as Control Data (UI Designer) by default.

image-20220930111701406

No.Description
1UI Designer (Control Data)
2UI Animation Designer (Animation Data)

UI Designer

Interface Descriptions

image-20220930105208311

No.NameDescription
1Menu BarProvide options about the UI Editor.
2ToolbarProvide operation options for controls.
3Control TreeDisplay controls and their hierarchy.
4Property ListDisplay the detailed properties of the control, which can be modified.
5Simulate Device Preview windowAdjust interface resolution and provide preview feature.
6Editing AreaDisplay position and size of the control.
7Control MenuDisplay the controls provided by the Editor by default. Click the control to place it in the Editing Area.

Binding Lua Scripts

Brief introduction to UI controls and Lua script usage.

Selecting UI Controls

Select the main_form control and a red box will appear in the Editing Area.

image-20220930105339269

Opening the Lua Script Binding Window

Click the image-20220930105418939button to open the Set Script window.

image-20220930105522547

image-20220930105931376

Form Binding Scripts

File Name: Only Form controls should be filled in. Specify Form controls and binding scripts (For example, form\new_ui).

Form Initialization Method

Init Function: Only Form controls should be filled in. The initialization method of the Form control: main_form_init.

new_ui.lua

--control callbacks--
---------------------

function main_form_init(form)
return 1
end

Adding Callbacks

Add a binding relationship between the control and the event. After selecting an event, an event is automatically generated in the Callback Function edit box (modifiable).

Click the image-20220930115225240button will bring up the Add Callback window:

image-20220930131445014

Select the callback method and an event is automatically generated in the edit box (modifiable), click the OK button to add it to the Set Script window:

image-20220930110316383

image-20220930110420657

image-20220930110520519

After the event is added successfully, the corresponding callback method needs to be added to new_ui.lua.

--control callbacks--
---------------------

function main_form_init(form)
return 1
end

function main_form_open(form)

return 1
end

function main_form_close(form)

return 1
end

Deleting Callbacks

Delete Callback: Delete a method that does not need a callback. Select the method to be deleted and click the Delete Callback button.

image-20220930110702833

UI Animation Designer

Click Animation Data to switch to the Animation Designer.

image-20220930131156570

Interface Descriptions

image-20220930111126311

No.NameDescription
1Menu BarProvide options about the UI Editor.
2Tool BarProvide operation options for controls.
3Editing ModeToggle between the current control and all controls.
4Animation TreeDisplay animations of each control and their hierarchy.
5Special Effects Property ListDisplay detailed properties of the animation effects selected in the Animation Tree.
6Simulate Device Preview WindowAdjust interface resolution and provide preview feature.
7Editing AreaDisplay position and animation effect of the control.
8Animation Data WindowAdd animations with some options.
9Control MenuDisplay the controls provided by the Editor by default. Click the control to place it in the Editing Area.