annotate ui/FontString.lua @ 13:bb0c8ce689d1 v1.2.15.0

fixed minor bug on startup with new settings
author yellowfive
date Thu, 10 Jul 2014 15:25:18 -0700
parents ece9167c0d1c
children e77e01abce98
rev   line source
yellowfive@11 1 local _, AskMrRobot = ...
yellowfive@11 2
yellowfive@11 3 -- initialize the Frame class (inherit from a dummy frame)
yellowfive@11 4 AskMrRobot.FontString = AskMrRobot.inheritsFrom(AskMrRobot.Frame:new():CreateFontString(nil, "ARTWORK", "GameFontNormal"))
yellowfive@11 5
yellowfive@11 6 -- Frame contructor
yellowfive@11 7 function AskMrRobot.FontString:new(parentFrame, name, layer, style, fontSize)
yellowfive@11 8
yellowfive@11 9 local o = parentFrame:CreateFontString(name, layer, style) -- create a new frame (if one isn't supplied)
yellowfive@11 10
yellowfive@11 11 -- use the fontstring class
yellowfive@11 12 setmetatable(o, { __index = AskMrRobot.FontString })
yellowfive@11 13
yellowfive@11 14 if fontSize then
yellowfive@11 15 o:SetFontSize(fontSize)
yellowfive@11 16 end
yellowfive@11 17
yellowfive@11 18 return o
yellowfive@11 19 end
yellowfive@11 20
yellowfive@11 21 function AskMrRobot.FontString:SetFontSize(fontSize)
yellowfive@11 22 local file, _, flags = self:GetFont()
yellowfive@11 23 self:SetFont(file, fontSize, flags)
yellowfive@11 24 end
yellowfive@11 25
yellowfive@11 26 function AskMrRobot.SetFontSize(fontString, fontSize)
yellowfive@11 27 local file, _, flags = fontString:GetFont()
yellowfive@11 28 fontString:SetFont(file, fontSize, flags)
yellowfive@11 29 end