Changes

Jump to navigation Jump to search
Line 155: Line 155:     
You can load in UIs using xml files with an html like structure using '''WindowManager.GenerateUI'''(List<XMLParser.XMLNode> nodes, GameObject parent, object callback). Example:  
 
You can load in UIs using xml files with an html like structure using '''WindowManager.GenerateUI'''(List<XMLParser.XMLNode> nodes, GameObject parent, object callback). Example:  
<nowiki><pre><code class="language-html"><window MinSize="0,0" NonLocTitle="Test window">
+
<nowiki><pre><code class="language-html">&lt;code class="language-html"&gt;&lt;pre&gt;
<ScrollView anchor="fill" position="4,4" size="-8,-8">
+
&lt;window MinSize="0,0" NonLocTitle="Test window"&gt;
<VerticalLayout anchor="top" padding="4,4,4,4" spacing="2" childForceExpandHeight="False" childControlHeight="False">
+
&lt;ScrollView anchor="fill" position="4,4" size="-8,-8"&gt;
<ContentFitter verticalFit="PreferredSize">
+
&lt;VerticalLayout anchor="top" padding="4,4,4,4" spacing="2" childForceExpandHeight="False" childControlHeight="False"&gt;
<label id="lab" color="FF0000" height="24">Hello</label>
+
&lt;ContentFitter verticalFit="PreferredSize"&gt;
<button onClick="ShowMessage(Hehe)" height="24">Click me</button>
+
&lt;label id="lab" color="FF0000" height="24"&gt;Hello&lt;/label&gt;
<combo height="24">a,b,c</combo>
+
&lt;button onClick="ShowMessage(Hehe)" height="24"&gt;Click me&lt;/button&gt;
</ContentFitter>
+
&lt;combo height="24"&gt;a,b,c&lt;/combo&gt;
</VerticalLayout>
+
&lt;/ContentFitter&gt;
</ScrollView>
+
&lt;/VerticalLayout&gt;
</window></code></pre></nowiki>
+
&lt;/ScrollView&gt;
 +
&lt;/window&gt;
 +
&lt;/pre&gt;&lt;/code&gt;</code></pre></nowiki>
 
This will create a window with a scroll view containing a label, a button and a combobox automatically laid out vertically. Please note that attributes, e.g. '''position'''="4,4" are case sensitive!
 
This will create a window with a scroll view containing a label, a button and a combobox automatically laid out vertically. Please note that attributes, e.g. '''position'''="4,4" are case sensitive!
  

Navigation menu