ScriptRegion:IsShown

From Warcraft Wiki
(Redirected from API ScriptRegion IsVisible)
Jump to navigation Jump to search
GitHub Octocat.png  Dragonflight-Icon-Inline.png  BTNTemp.png  Wowprogramming.png ScriptRegion:Show
GitHub Octocat.png  Dragonflight-Icon-Inline.png  BTNTemp.png  Wowprogramming.png ScriptRegion:Hide
GitHub Octocat.png  Dragonflight-Icon-Inline.png  BTNTemp.png ScriptRegion:SetShown
GitHub Octocat.png  Dragonflight-Icon-Inline.png  BTNTemp.png  Wowprogramming.png ScriptRegion:IsShown
GitHub Octocat.png  Dragonflight-Icon-Inline.png  BTNTemp.png  Wowprogramming.png ScriptRegion:IsVisible
GitHub Octocat.png  Dragonflight-Icon-Inline.png  BTNTemp.png OnShow
GitHub Octocat.png  Dragonflight-Icon-Inline.png  BTNTemp.png OnHide

Returns whether the region (and its parents) are shown.

isShown   = ScriptRegion:IsShown()
isVisible = ScriptRegion:IsVisible()

Returns

isShown
boolean - True if the region should be shown, but it depends on the parents if it's visible.
isVisible
boolean - True if the region and its parents are shown, making it effectively visible.

Details

  • Frames are shown by default when they are created.
  • Setting the region's alpha to zero would make it invisible but still interactable.

Example

local f = CreateFrame("Frame", nil, nil, "BackdropTemplate")
f:SetPoint("CENTER")
f:SetSize(200, 200)
f:SetBackdrop(BACKDROP_TUTORIAL_16_16)
-- the region is visible
print(f:IsShown(), f:IsVisible()) -- true, true

-- parent it to a hidden frame
local g = CreateFrame("Frame")
g:Hide()
f:SetParent(g)
-- the region is no longer visible
print(f:IsShown(), f:IsVisible()) -- true, false