ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Simple XML file to Display a button on screen (https://www.esoui.com/forums/showthread.php?t=10699)

winslowe 09/21/23 09:54 AM

Simple XML file to Display a button on screen
 
Just started with Dev addons. I do best with examples.
I have tried a few things but they are not working.
Can someone give me a Simple XML file example of how to display a Click on button in the middle of the screen. From there I can learn how to move it where I want it.

I have this but it is not working.

<!-- MyButtonAddon.xml -->
<Controls>
<Button name="MyButton" inherits="ZO_DefaultButton" text="Click Me">
<Anchor point="CENTER" relativeTo="$(parent)" relativePoint="CENTER" offsetX="0" offsetY="0" />
</Button>
</Controls>

Baertram 09/21/23 10:24 AM

I'd read this tutorial about GUI (XML):
https://wiki.esoui.com/SimpleNotebookTutorial/part6

You need to define a TopLevelControl and then anchor your buton on it.
Without the TLC you cannot draw any controls directly to the GUI.
Think about it as a rectangle where you anchor yoru button and other conrols to, like a menu, but not visible (unless you add a backdrop texture as background).

Code:

<GuiXml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sir.insidi.at/or/schema/esoui.xsd">
        <Controls>
            <TopLevelControl name="MyTestTLC" hidden="false" movable="true">
              <Dimensions x="200" y="200" />
              <Anchor point="CENTER" />
              <Controls> 
                You button control etc. here
              </Controls>
          </TopLevelControl>
        </Controls>
</GuiXml>


If you want to add the button to any existing control, you need to anchor it to that control so it shows (e.g. at the inventory).


All times are GMT -6. The time now is 02:44 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI