Skip to content
everloot

Lore archive · Warcraft Wiki, 2023 dump

API FontInstance SetTextColor

Last wiki revision 2013-01-04

Sets the object's text color.

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

  • 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)

Button:SetTextColor was deleted in Patch 3.0.2, 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);

Source

https://warcraft.wiki.gg/wiki/API_FontInstance_SetTextColor · retrieved 2023-11-13 · CC BY-SA 4.0

Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.

This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.