yellowfive@11: local _, AskMrRobot = ... yellowfive@11: yellowfive@11: -- initialize the Frame class (inherit from a dummy frame) yellowfive@11: AskMrRobot.FontString = AskMrRobot.inheritsFrom(AskMrRobot.Frame:new():CreateFontString(nil, "ARTWORK", "GameFontNormal")) yellowfive@11: yellowfive@11: -- Frame contructor yellowfive@11: function AskMrRobot.FontString:new(parentFrame, name, layer, style, fontSize) yellowfive@11: yellowfive@11: local o = parentFrame:CreateFontString(name, layer, style) -- create a new frame (if one isn't supplied) yellowfive@11: yellowfive@11: -- use the fontstring class yellowfive@11: setmetatable(o, { __index = AskMrRobot.FontString }) yellowfive@11: yellowfive@11: if fontSize then yellowfive@11: o:SetFontSize(fontSize) yellowfive@11: end yellowfive@11: yellowfive@11: return o yellowfive@11: end yellowfive@11: yellowfive@11: function AskMrRobot.FontString:SetFontSize(fontSize) yellowfive@11: local file, _, flags = self:GetFont() yellowfive@11: self:SetFont(file, fontSize, flags) yellowfive@11: end yellowfive@11: adam@17: function AskMrRobot.FontString:IncreaseFontSize(add) adam@17: local file, fontSize, flags = self:GetFont() adam@17: self:SetFont(file, fontSize + add, flags) adam@17: end adam@17: yellowfive@11: function AskMrRobot.SetFontSize(fontString, fontSize) yellowfive@11: local file, _, flags = fontString:GetFont() yellowfive@11: fontString:SetFont(file, fontSize, flags) yellowfive@11: end