wowpedia
Main Menu


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

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

References