Creating a Frame in XML can be a long winded process, especially when you see how little it takes to create one using LUA.
Let’s get to it! Here is a sample LUA showing how to create a Frame:
MyFrame = CreateFrame("Frame","MyFrame",UIParent)
MyFrame:SetPoint("CENTER",0,0)
MyFrame:SetWidth(200)
MyFrame:SetHeight(200)
See how easy that was? What we have done here is created a frame with the name MyFrame and setting its parent to the UIParent.
If your addon isn’t going to hook it to anything else, then it’s best to set the UIParent as the parent frame. After we set its anchor, using the SetPoint function, to the Center with an offset (X & Y) of both 0. We then set the Width and Height both to 200. Now you wont actually see anything as we haven’t changed any colours or set any textures, but the frame will be there.

This post is really just to tie all the tutorials/walkthroughs together for getting to grips with creating a WoW addon.

1 Comment »