Skip to content

Script driven GUI System

Cook Green edited this page May 4, 2020 · 8 revisions

Summary

Parts

UI Layout Xml File

Example:

<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>

UI Script File

Entry Function

Entry function for UI is uiInit function, you can add some init code in this function

Event Change Function

You can capture the UI event change in uiEventChanged function, this function needs two paramters:
Param 1: widgetID
Param 2: value

Example:

function uiEventChanged
  store_input_param %widgetID 1
  store_input_param %value 2 
  ...other code...  
end

Clone this wiki locally