Conceptually this code should work, but I think there's one small change that will make it actually work. ;)
Code:
for oyslop = 2, 8 do
oys[oyslop] = UI.CreateFrame("Text","oysFrame"..tostring(oyslop),oys)
oys[oyslop]:SetPoint("TOPCENTER",oys[oyslop-1],"BOTTOMCENTER")
oys[oyslop]:SetWidth(150)
oys[oyslop]:SetHeight(16)
oys[oyslop]:SetBackgroundColor(.20,.20,.20,.50)
oys[oyslop]:SetFontSize(12)
oys[oyslop]:SetText("Frame Number: " ..tostring(oyslop))
function oys[oyslop].Event:MouseIn()
self:SetFontSize(22)
self:SetHeight(26)
end
function oys[oyslop].Event:MouseOut()
self:SetFontSize(12)
self:SetHeight(16)
end
end Alternatively, as seebs suggested, you can do something like:
Code:
function oysMouseIn()
self:SetFontSize(22)
self:SetHeight(26)
end
function oysMouseOut()
self:SetFontSize(12)
self:SetHeight(16)
end
for oyslop = 2, 8 do
oys[oyslop] = UI.CreateFrame("Text","oysFrame"..tostring(oyslop),oys)
oys[oyslop]:SetPoint("TOPCENTER",oys[oyslop-1],"BOTTOMCENTER")
oys[oyslop]:SetWidth(150)
oys[oyslop]:SetHeight(16)
oys[oyslop]:SetBackgroundColor(.20,.20,.20,.50)
oys[oyslop]:SetFontSize(12)
oys[oyslop]:SetText("Frame Number: " ..tostring(oyslop))
oys[oyslop].Event.MouseIn = oysMouseIn
oys[oyslop].Event.MouseOut = oysMouseOut
end One thing to keep in mind is that the ":" is just syntactic sugar in LUA. There's no difference between
Code:
function frame.Event:MouseIn()
...
end
and
Code:
frame.Event.MouseIn = function()
...
end
Bookmarks