Region:SetAlpha

From Warcraft Wiki
Jump to navigation Jump to search
AllowedWhenTainted
Enum.SecretAspect.Alpha
Links
Widget API

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

  • Midnight Patch 12.0.0 (Beta): SetAlpha now always clamps its value to the range [0, 1] without raising an error.
  • Dragonflight Patch 10.0.0 (2022-10-25): Throws an error when the alpha argument is outside the [0, 1] range.
  • Burning Crusade 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