annotate ui/FontString.lua @ 17:e77e01abce98

Warlords of Draenor pre-patch
author Adam tegen <adam.tegen@gmail.com>
date Mon, 13 Oct 2014 21:28:32 -0500
parents ece9167c0d1c
children
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
adam@17 26 function AskMrRobot.FontString:IncreaseFontSize(add)
adam@17 27 local file, fontSize, flags = self:GetFont()
adam@17 28 self:SetFont(file, fontSize + add, flags)
adam@17 29 end
adam@17 30
yellowfive@11 31 function AskMrRobot.SetFontSize(fontString, fontSize)
yellowfive@11 32 local file, _, flags = fontString:GetFont()
yellowfive@11 33 fontString:SetFont(file, fontSize, flags)
yellowfive@11 34 end