Thread Tools Display Modes
Prev Previous Post   Next Post Next
07/24/14, 09:10 AM   #1
zgrssd
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 280
Lua XML Basics

I am trying to get the hang of UI XML and so far I am not getting good. So I think need to start with a lot more basic stuff.

The top element of all XML files must be the "<GuiXml>" Tag
The second tier must tbe the "<Controls>" Tag under wich you can define your actuall elements.

There seem to be at least 3 Container Elements (elements with a Controls child element):
GuiXML - the root of all XML files
TopLevelControl - For Windows. Is automatically added to the UI upon execution without needing to call it.
Control - for templates in particular. It also seems to be the only "Container" you can use at any level.


Data like the Dimensions, anchoring or fill mode are not listed as Atributes of the Element. Instead they are assigned via child elements called "Anchoring" or "Dimensions". Not sure how to call those class, "Child Atributes" perhaps?
Data like Backdrops (the background to be used) must be assigned as a Child of the Controls object that is itself asigned as child of the container. So the most basic Window XML looks somewhat like this:
xml Code:
  1. <GuiXml>
  2.     <Controls>
  3.         <TopLevelControl name="testbedWindow">
  4.             <Dimensions x="400" y="400" />
  5.             <Anchor point="CENTER" />
  6.             <Controls>
  7.                 <--Other Child elements like labels would go here too-->
  8.                 <Backdrop name="$(parent)BG" inherits="ZO_DefaultBackdrop" />
  9.             </Controls>
  10.         </TopLevelControl>
  11.     </Controls>
  12. </GuiXml>

Know Atributes:
name - (optional) a Reference to this element will be stored in the Global Variables with this name. This is nessesary if you want to access it from code behind directly. The '$(parent)[suffix]' Syntax allows you to name a Child based on the name of it's parent and a suffix.
inherits - Seems to allow high level behavior changes. A Control type Container where 'inherits="ZO_ScrollContainer"' is written, behaves as a Scroll Container (if the Content is bigger then the Containers dimension, a Scroll Bar appears).
hidden - boolean value. Determines if the element is hidden by default. Usefull in particular for TopLevelControls that should be initialised automatically, but not shown automatically (there but hidden)
font, text - common for Elements that show Text, be it labels, Editboxes.
virtual - if true, this is a virtual Element. It is used as template for teh "CreateFromVirtual" function. Is not put into the global namespace, but instead used as String Indentifier for the "CreateFromVirtual" function.


Questions:
Wich Elements can all have a "Controls" child element?
Wich common GUI Values must be assigned as atributes, wich as Direct level child element and wich as Controls Child Element?
  Reply With Quote
 

ESOUI » Developer Discussions » Lua/XML Help » Lua XML Basics


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