-
Notifications
You must be signed in to change notification settings - Fork 18
Script driven GUI System
DoDoCat edited this page Aug 13, 2020
·
8 revisions
The UILayout Node is the root of the UI Xml definetion
ID - ID for this UI
The Background Node described the UI background
Type - UI Background Type
The Script Node attached the script file for this UI
Widgets Node included many Widget Node for describing the widgets of this UI
Widget Node described a specific Widget defined in engine or mod
Widget Parameters will give the parameters to the widget factory when contruct the widget
<UILayout ID="ui_custom_game">
<Background Type="NoChange"></Background>
<Script>ui_custom_game.script</Script>
<Widgets>
<Widget Type="Label" TrayLocation="TL_TOP">
<WidgetParameters>
<WidgetParameter Name="name" Type="String">lbTitle</WidgetParameter>
<WidgetParameter Name="caption" Type="String">str_custom_game_title</WidgetParameter>
<WidgetParameter Name="width" Type="Float">200</WidgetParameter>
</WidgetParameters>
</Widget>
</Widgets>
</UILayout>
Entry function for UI is uiInit function, you can add some init code in this function
You can capture the UI event change in uiEventChanged function, this function needs two paramters:
Param 1: widgetID
Param 2: value
function uiEventChanged
store_input_param %widgetID 1
store_input_param %value 2
...other code...
end