Region:SetAlpha

From Warcraft Wiki
Jump to navigation Jump to search
GitHub Octocat.png  Dragonflight-Icon-Inline.png  BTNTemp.png  Wowprogramming.png Region:GetAlpha
GitHub Octocat.png  Dragonflight-Icon-Inline.png  BTNTemp.png  Wowprogramming.png Frame:GetEffectiveAlpha
GitHub Octocat.png  Dragonflight-Icon-Inline.png  BTNTemp.png  Wowprogramming.png Region:SetAlpha
GitHub Octocat.png  Dragonflight-Icon-Inline.png  BTNTemp.png Region:SetIgnoreParentAlpha
GitHub Octocat.png  Dragonflight-Icon-Inline.png  BTNTemp.png Region:IsIgnoringParentAlpha

Sets the opacity of the region.

Region:SetAlpha(alpha)

Arguments

alpha
number [0.0 - 1.0] - The alpha of the region. 0 is fully transparent, 1 is fully opaque.

Example

Creates a texture that is 50% transparent.

local tex = UIParent:CreateTexture()
tex:SetPoint("CENTER")
tex:SetTexture("interface/icons/inv_mushroom_11")

tex:SetAlpha(.5)

API Region SetAlpha 01.png

Patch changes

  • Dragonflight Patch 10.0.0 (2022-10-25): Throws an error when the alpha argument is outside the [0, 1] range.
  • Bc icon.gif Patch 2.1.0 (2007-05-22): A frame's alpha value now also affects all of its descendants.[1]
    "Frame alpha now propagates in the same way as scale (though is clamped between 0 and 1 on each object). This means you can cleanly fade the whole UI or specific frame assemblies."

References