Skip to content

Instantly share code, notes, and snippets.

@jnwhiteh
Created June 19, 2013 18:00
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jnwhiteh/5816405 to your computer and use it in GitHub Desktop.
Save jnwhiteh/5816405 to your computer and use it in GitHub Desktop.
An example addon showing a simple frame in XML used in Lua
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)
print("Before the XML is loaded", FrameTestFrame)
## Interface: 50300
## Name: FrameTest
Before.lua
FrameTest.xml
After.lua
<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>
@thomas-soutif
Copy link

Thanks, that's help me a lot !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment