public
Created

An example addon showing a simple frame in XML used in Lua

  • Download Gist
After.lua
Lua
1 2 3 4 5 6 7 8 9 10 11 12
print("After the XML is loaded", FrameTestFrame)
 
local seconds = 10
local total = 0
FrameTestFrame:SetScript("OnUpdate", function(self, elapsed)
total = total + elapsed
if total > seconds then
self:SetScript("OnUpdate", nil)
end
local sides = 100 + (100 * (total / seconds))
self:SetSize(sides, sides)
end)
Before.lua
Lua
1
print("Before the XML is loaded", FrameTestFrame)
FrameTest.toc
TeX
1 2 3 4 5 6
## Interface: 50300
## Name: FrameTest
 
Before.lua
FrameTest.xml
After.lua
FrameTest.xml
XML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<Frame name="FrameTestFrame">
<Size>
<AbsDimension x="25" y="25"/>
</Size>
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
<BackgroundInsets>
<AbsInset left="11" right="12" top="12" bottom="11"/>
</BackgroundInsets>
<TileSize>
<AbsValue val="32"/>
</TileSize>
<EdgeSize>
<AbsValue val="32"/>
</EdgeSize>
</Backdrop>
</Frame>
</Ui>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.