Thread Tools Display Modes
09/21/23, 09:54 AM   #1
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 -->
<Button name="MyButton" inherits="ZO_DefaultButton" text="Click Me">
<Anchor point="CENTER" relativeTo="$(parent)" relativePoint="CENTER" offsetX="0" offsetY="0" />
  Reply With Quote
09/21/23, 10:24 AM   #2
Super Moderator
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,777
I'd read this tutorial about GUI (XML):

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).

<GuiXml xmlns:xsi="" xsi:noNamespaceSchemaLocation="">
            <TopLevelControl name="MyTestTLC" hidden="false" movable="true">
               <Dimensions x="200" y="200" />
              <Anchor point="CENTER" />
                 You button control etc. here

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

Thread Tools
Display Modes

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