View Single Post
07-21-08, 03:35 AM   #7
Slakah
A Molten Giant
 
Slakah's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 863
Originally Posted by Dreadlorde View Post
Would something like this work?
Code:
local chimaine = CreateFrame("frame",nil,UIParent)
Theres no point really you can create a frame using UIParent.

Code:
local tex = UIParent:CreateTexture(entry.name) 
tex:SetWidth(entry.width) 
tex:SetHeight(entry.height)
I personally wouldn't use a table for none dynamic frames. I would just create a function to set up a texture using args passed to it.

i.e.
Code:
local maketex(name, height, width, ...)
   local tex = UIParent:CreateTexture(name)
   tex:SetHeight(height)
   tex:SetWidth(width)
   tex:SetPoint(...)
end

maketex("Cow", 10, 10, "TOPLEFT", UIParent, "BOTTOMRIGHT", -1, 2)
--etc.
I would just like to point out chimaine.SetHeight(entry.height) does not equal chimaine:SetHeight(entry.height) but,

Code:
chimaine:SetHeight(entry.height)
=
Code:
chimaine.SetHeight(chimaine, entry.height)
  Reply With Quote