WoW:API FontInstance SetTextColor: Difference between revisions

m
Move page script moved page API FontInstance SetTextColor to WoW:API FontInstance SetTextColor without leaving a redirect
(clarify button vs fontinstance)
m (Move page script moved page API FontInstance SetTextColor to WoW:API FontInstance SetTextColor without leaving a redirect)
 
(One intermediate revision by one other user not shown)
Line 15: Line 15:
::Note that Button:SetTextColor was deleted in 3.0, but FontInstance:SetTextColor remains. To set the button text color, you need to set the button font object, then get a copy of it, then modify the color of the new object and then assign the copy back to the button. For example:
::Note that Button:SetTextColor was deleted in 3.0, but FontInstance:SetTextColor remains. To set the button text color, you need to set the button font object, then get a copy of it, then modify the color of the new object and then assign the copy back to the button. For example:


:button:SetNormalFontObject("GameFontHighlight");
button:SetNormalFontObject("GameFontHighlight");
:local font = button:GetNormalFontObject();
local font = button:GetNormalFontObject();
:font:SetTextColor(1, 0.5, 0.25, 1.0);
font:SetTextColor(1, 0.5, 0.25, 1.0);
:button:SetNormalFontObject(font);
button:SetNormalFontObject(font);


== See Also ==
== See Also ==
* [[API Button SetHighlightTextColor|Button:SetHighlightTextColor]]()
* [[API Button SetHighlightTextColor|Button:SetHighlightTextColor]]()
Anonymous user