Thread Tools Display Modes
02-26-11, 10:20 AM   #1
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
GameFontBlack

Is there any way to change this font? color? :<

i've tryed and not working

Code:
for _, font in pairs({

             _G["GameFontBlack"],

}) do
    font:SetFont('Fonts\\ARIALN.ttf', 14, 'THINOUTLINE')
    font:SetTextColor(1, 1, 1)
end
  Reply With Quote
02-26-11, 11:43 AM   #2
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Is this snippet part of something? What is _G["GameFontBlack"]? Are you sure it contains FontString objects?

Does
Code:
for _, font in pairs({

             _G["GameFontBlack"],

}) do
    print(font:GetTextColor(1, 1, 1))
end
prints anything?

You can't recolor black textures. If the fonts textures are black font:SetTextColor(1, 1, 1) won't work. But the fonts path is 'Fonts\\ARIALN.ttf' - which is imho a wow standard font. So this can't be the problem.
  Reply With Quote
02-26-11, 03:37 PM   #3
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Originally Posted by Duugu View Post
Is this snippet part of something? What is _G["GameFontBlack"]? Are you sure it contains FontString objects?

Does
Code:
for _, font in pairs({

             _G["GameFontBlack"],

}) do
    print(font:GetTextColor(1, 1, 1))
end
prints anything?

You can't recolor black textures. If the fonts textures are black font:SetTextColor(1, 1, 1) won't work. But the fonts path is 'Fonts\\ARIALN.ttf' - which is imho a wow standard font. So this can't be the problem.
It didn't print.. anyways this no i need that to change fontsize + fontflag, else it wont work (I guess)
Attached Images
File Type: jpg WoWScrnShot_022611_223435.jpg (1.61 MB, 748 views)
  Reply With Quote
02-26-11, 03:43 PM   #4
Sniffles
A Black Drake
 
Sniffles's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2010
Posts: 86
GameFontBlack isn't a Font it's a FontStyle.
  Reply With Quote
02-26-11, 03:52 PM   #5
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Right. You'll have to change anything that uses GameFontBlack.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
02-26-11, 05:40 PM   #6
sacrife
An Onyxian Warder
 
sacrife's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 384
Try this.

lua Code:
  1. local function SetFont(obj, font, size, style, alpha, r, g, b, sr, sg, sb, sox, soy, spacing)
  2.     obj:SetFont(font, size, style)
  3.     if sr and sg and sb then obj:SetShadowColor(sr, sg, sb) end
  4.     if sox and soy then obj:SetShadowOffset(sox, soy) end
  5.     if r and g and b then obj:SetTextColor(r, g, b) end
  6.     if alpha then obj:SetAlpha(r) end
  7.     if spacing then obj:SetSpacing(spacing) end
  8. end
  9.  
  10. local f = CreateFrame("Frame")
  11. f:RegisterEvent("ADDON_LOADED")
  12. f:SetScript("OnEvent", function()
  13.  
  14. SetFont(GameFontBlack, font, fontsize, outline, 1, 1, 1, 1, 0, 0, 0, 0, 0);
__________________

  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » GameFontBlack


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off