Changes

Jump to navigation Jump to search
Line 171: Line 171:     
The game will try to find a corrosponding variable to set for the element for any other attributes you use (Rememeber case sensivity). Some elements, like the button and combo have event variable, i.e. onClick and OnSelectedChanged (use visual studio's code lookup feature to see what is possible), these can be set to function calls that will be called directly on an object you set when creating the UI, i.e. the  onClick="ShowMessage(Hehe)" part. Here's an example of how you would create and use this UI:
 
The game will try to find a corrosponding variable to set for the element for any other attributes you use (Rememeber case sensivity). Some elements, like the button and combo have event variable, i.e. onClick and OnSelectedChanged (use visual studio's code lookup feature to see what is possible), these can be set to function calls that will be called directly on an object you set when creating the UI, i.e. the  onClick="ShowMessage(Hehe)" part. Here's an example of how you would create and use this UI:
<pre class="language-cs">var elements = WindowManager.GenerateUI(ParentMod.LoadFullXMLFile("UI.xml"), null, this)["lab"];
+
<pre class="language-cs">var elements = WindowManager.GenerateUI(ParentMod.LoadFullXMLFile("UI.xml"), null, this);
 
var label = (Text)elements["lab"];
 
var label = (Text)elements["lab"];
 
Debug.log(label.text);
 
Debug.log(label.text);

Navigation menu