After we have managed to compile our GFx file properly, we need to expose the UI element to Flow Graph or Schematyc (Experimental) in order for us to connect gameplay functionality to the button presses.
This is done by either navigating to an existing path in the Libs
folder, or by creating your own folder to house your UI elements.
Create an XML file named uiQuickStart.xml and place it in the path <engine root>\Game\Libs\UI\UIElements\>.
uiQuickstart.xml
Below you can see an example of the most basic XML that must be drafted in order to be seen in Flow Graph/Schematyc (Experimental). By default, several attributes are included in the settings. The two most important sections to keep in mind beyond the file declaration are the layer attributes, and the constraints that allow you to define how content is exposed.
Layers by default define in which order the elements are drawn in case you have multiple Flash files running simultaneously and need to sort them logically. As for constraints, they allow for you to dynamically position an object to correspond to the middle of the vertical axis, horizontal axis, or both.
It is important to note that you can also change these attributes later within Flow Graph/Schematyc (Experimental) and that the values set within this file are simply a starting reference for you to work with.
<!-- Category name, of your own choosing -->
<UIElements name="uiQuickStart">
<!-- Object name, again, of your own choosing -->
<UIElement name="uiQuickStart" render_lockless="1">
<!-- Point it to the correct files and give it some default settings -->
<GFx file="uiQuickStart.gfx" layer="0">
<Constraints>
<Align mode="dynamic" valign="center" halign="center" scale="0" max="0"/>
</Constraints>
</GFx>
</UIElement>
</UIElements>
It is not recommended to mix the Flow Graph and Schematyc (Experimental) approaches as them sharing UI Element instances can lead to confusing results and issues that are hard to track.
You should now be able to see your UI displayed on-screen upon entering Game mode in the Sandbox Editor.