I am surely missing something obvious. I want to display crit damage in a larger font than normal damage. Accordingly, I wrote the following code:
f.Text = f:CreateFontString("Bazooka")
if isCrit then
f.Text:SetFont( "Interface\\Addons\\CleuLib\\Fonts\\Bazooka.ttf", 32 )
else
f.Text:SetFont( "Interface\\Addons\\CleuLib\\Fonts\\Bazooka.ttf", 24 )
end
This doesn’t work and I would appreciate learning what I’m doing wrong.
Thanks, in advance,
A boolean variable that governs whether the font is to be larger than normal (32 instead of 24).
That would have to be reset the font/size every time your FontString text changes otherwise it will just remain the same font/size as when created.
ie. you don’t create a new FontString every time you want to change some text, you create it once and after that call its :SetText(…) to change the contents
f.Text = f:CreateFontString("Bazooka")
f.Text:SetFont( "Interface\\Addons\\CleuLib\\Fonts\\Bazooka.ttf", 24 )
-- ... some time later on ...
if isCrit then
f.Text:SetFont( "Interface\\Addons\\CleuLib\\Fonts\\Bazooka.ttf", 32 )
else
f.Text:SetFont( "Interface\\Addons\\CleuLib\\Fonts\\Bazooka.ttf", 24 )
end
f.Text:SetText("You can tell if this is a crit by how big the text is!")