| 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"><code class="language-html"><pre> |
| − | <ScrollView anchor="fill" position="4,4" size="-8,-8"> | + | <window MinSize="0,0" NonLocTitle="Test window"> |
| − | <VerticalLayout anchor="top" padding="4,4,4,4" spacing="2" childForceExpandHeight="False" childControlHeight="False"> | + | <ScrollView anchor="fill" position="4,4" size="-8,-8"> |
| − | <ContentFitter verticalFit="PreferredSize"> | + | <VerticalLayout anchor="top" padding="4,4,4,4" spacing="2" childForceExpandHeight="False" childControlHeight="False"> |
| − | <label id="lab" color="FF0000" height="24">Hello</label> | + | <ContentFitter verticalFit="PreferredSize"> |
| − | <button onClick="ShowMessage(Hehe)" height="24">Click me</button> | + | <label id="lab" color="FF0000" height="24">Hello</label> |
| − | <combo height="24">a,b,c</combo> | + | <button onClick="ShowMessage(Hehe)" height="24">Click me</button> |
| − | </ContentFitter> | + | <combo height="24">a,b,c</combo> |
| − | </VerticalLayout> | + | </ContentFitter> |
| − | </ScrollView> | + | </VerticalLayout> |
| − | </window></code></pre></nowiki>
| + | </ScrollView> |
| | + | </window> |
| | + | </pre></code></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! |
| | | | |