Wowpedia
Advertisement
Wowpedia
240,467
pages

Methods

It has the same methods as Texture except the texture mask API and is created from Frame:CreateMaskTexture()

- Texture:AddMaskTexture(maskTexture)
- Texture:GetMaskTexture(index)
- Texture:RemoveMaskTexture(maskTexture)
- Texture:SetMask(maskName)

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

References

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