Thread Tools Display Modes
09/21/23, 09:54 AM   #1
winslowe
Join Date: Feb 2023
Posts: 1
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>
  Reply With Quote
09/21/23, 10:24 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
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).

Last edited by Baertram : 09/21/23 at 10:34 AM.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Simple XML file to Display a button on screen


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off