Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
No edit summary
m (Added a code frame around the example code.)
(4 intermediate revisions by 3 users not shown)
Line 11: Line 11:
 
:;blue: Number - Blue part of color (0.0 -- 1.0)
 
:;blue: Number - Blue part of color (0.0 -- 1.0)
 
:;alpha: Number - Alpha (transparency) value (0.0 for totally transparent, 1.0 for solid color)
 
:;alpha: Number - Alpha (transparency) value (0.0 for totally transparent, 1.0 for solid color)
  +
  +
;12/5/08
  +
::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");
  +
local font = button:GetNormalFontObject();
  +
font:SetTextColor(1, 0.5, 0.25, 1.0);
  +
button:SetNormalFontObject(font);
   
 
== See Also ==
 
== See Also ==

Revision as of 13:46, 11 June 2010

Sets the object's text color.

obj:SetTextColor(red, green, blue[, alpha])

Arguments

red
Number - Red part of color (0.0 -- 1.0)
green
Number - Green part of color (0.0 -- 1.0)
blue
Number - Blue part of color (0.0 -- 1.0)
alpha
Number - Alpha (transparency) value (0.0 for totally transparent, 1.0 for solid color)
12/5/08
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");
local font = button:GetNormalFontObject();
font:SetTextColor(1, 0.5, 0.25, 1.0);
button:SetNormalFontObject(font);

See Also