Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
WoW
Talk
English
Views
Read
Edit
History
More
Search
Navigation
Home
Random page
Help using wiki
Editions
for WoW
for WildStar
for Solar2D
Documentation
for WoW
for WildStar
Reference
WoW
⦁ FrameXML
⦁ AddOns
⦁ API
⦁ WoW Lua
WildStar
⦁ AddOns
⦁ API
⦁ WildStar Lua
Engine
Tools
What links here
Related changes
Special pages
Page information
Site
Recent Changes
Editing
WoW:UI XML tutorial
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== The Basics == An [[XML]] file is a collection of ''elements'' (with a start and end tag), of which the User Interface files are no exception. There are two main types of elements that appear in the UI XML files. The first type are those that declare user interface items or [[widget]]s, such as [[XML/Button|Button]]s, [[XML/Frame|Frames]], [[XML/CheckButton|Checkbox]]es. We will call these widget elements. The second type of element, which always occur inside the first type, define properties and behaviour of the widgets. We will call these property elements. Here is an example: <Button name="MyAddon_Button"> <Anchors> <Anchor point="CENTER"/> </Anchors> </Button> The [[XML/Button|Button]] element is of the first type, in other words a widget element. Its appearance in the XML file causes a Button with the name '''MyAddon_Button''' to be created. The elements inside it (such as [[Anchors]], Anchor) define its properties, hence are of the second type. The general structure is always the same, you have elements representing widgets, and other elements inside them representing their properties. It can also happen that a widget element is inside another one. For example: <Frame name="MyAddon_Frame"> <Anchors> <Anchor point="CENTER"/> </Anchors> <Frames> <Button name="MyAddon_Button"> <Anchors> <Anchor point="CENTER"/> </Anchors> </Button> </Frames> </Frame> This example has two [[widget]] elements, [[XML/Frame|Frames]] and [[XML/Button|Button]], and several property elements ([[Anchors]], Anchor). This creates a Frame, with a Button inside it. Here, '''MyAddon_Button''' is a ''child'' of '''MyAddon_Frame''', and '''MyAddon_Frame''' is a ''parent'' of '''MyAddon_Button'''. Also note how the XML convention of abbreviating an empty element such as <Anchor point="CENTER"></Anchor> as <Anchor point="CENTER"/> is used. Many of the elements (widget and property alike) can have ''attributes'', such as the '''name''' attribute in the above examples. A complete and valid XML file must contain exactly one element named UI, with some rather long attributes (best use copy/paste for this). Hence a minimal example of a complete UI XML file would be something like: <Ui xmlns="<nowiki>http://www.blizzard.com/wow/ui/</nowiki>" xmlns:xsi="<nowiki>http://www.w3.org/2001/XMLSchema-instance</nowiki>" xsi:schemaLocation="<nowiki>http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd</nowiki>"> <Frame name="MyAddon_Frame"> </Frame> </Ui> Such a file will create a single [[XML/Frame|Frames]], named '''MyAddon_Frame'''. However, that Frame wouldn't be visible and wouldn't have any content.
Summary:
Please note that all contributions to AddOn Studio are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
AddOn Studio Wiki:Copyrights
for details).
Submissions must be written by you, or copied from a public domain or similar free resource (see
AddOn Studio Wiki:Copyrights
for details).
Cancel
Editing help
(opens in new window)