The API is no longer being updated here until further notice. |
Manages the alpha (or opacity) of any text using a Font object.
font:SetAlpha(alpha) alpha = font:GetAlpha()
Attribute[]
- alpha
- number - Opacity of the text as a proportion from 0 (transparent) to 1 (opaque)
Details[]
- Font:SetAlpha() and Region:SetAlpha() are two different kinds of alpha, but how they interact varies:
- FontString simply adopts whichever alpha was set most recently.
- EditBox, SimpleHTML and MessageFrame use their Region alpha for backgrounds and borders, but multiply both alphas together for text.
Example[]
An EditBox with 50% alpha, assigned a Font with 50% alpha. The text's net alpha is returned using a generic formula.
local frame = CreateFrame("EditBox")
frame:SetAlpha(0.5)
frame:SetFontObject(CreateFont("MyFont"));
frame:GetFontObject():SetAlpha(0.5)
local netAlpha = ( (frame:IsIgnoringParentAlpha() and frame:GetAlpha()) or frame:GetEffectiveAlpha() ) * ( (frame:GetFontObject() and frame:GetFontObject():GetAlpha()) or 1 )
print(netAlpha) --0.25
Patch changes[]
- Patch 1.10.0 (2006-03-28): Added.[1]
References[]
- ^ Iriel 2005-12-28. Upcoming 1.10 Changes - Concise List. Archived from the original