Wowpedia
Advertisement
Wowpedia
240,458
pages

Creates a MaskTexture object from a Frame.

mask = Frame:CreateMaskTexture([name [, layer, inheritsFrom, subLayer])

Arguments

name 
string
layer 
string : layer
inheritsFrom 
string
subLayer 
number

Returns

mask 
object : MaskTexture

Example

UIOBJECT MaskTexture1.png

local f = CreateFrame("Frame")
f:SetPoint("CENTER")
f:SetSize(32, 32)

f.tex = f:CreateTexture(nil, "ARTWORK")
f.tex:SetAllPoints(f)
f.tex:SetTexture("Interface/Tooltips/UI-Tooltip-Background")
f.tex:SetColorTexture(0, 0, 0, 0.5) -- black, 50% opacity

f.mask = f:CreateMaskTexture()
f.mask:SetAllPoints(f.tex)
f.mask:SetTexture("Interface/CHARACTERFRAME/TempPortraitAlphaMask", "CLAMPTOBLACKADDITIVE", "CLAMPTOBLACKADDITIVE")
f.tex:AddMaskTexture(f.mask)

UIOBJECT MaskTexture2.png

local f = CreateFrame("Frame", nil, UIParent)
f:SetPoint("CENTER")
f:SetSize(64, 64)

f.tex = f:CreateTexture()
f.tex:SetAllPoints(f)
f.tex:SetTexture("Interface/Icons/Ability_Ambush")
f.tex:SetMask("Interface/ChatFrame/UI-ChatIcon-HotS")

Patch changes

See also

References

  1. ^ Resike 2016-02-29. Texture:SetMask().
  2. ^ guema 2017-05-02. MaskTexture : new widget for 7.2.
Advertisement