Widget API: Region:IsVisible

Revision as of 04:47, 15 August 2023 by Move page script (talk | contribs) (Move page script moved page API Region IsVisible to API Region IsVisible without leaving a redirect)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Widget API ← Region < IsVisible

Return whether or not an object would actually be visible on-screen, ignoring the possibility that the object could be dragged off the edge of the screen.

visible = MyObject:IsVisible();

ReturnsEdit

visible
boolean - true if the object is visible

ExampleEdit

if MyFrame:IsVisible() then
  MyAddon_UpdateSomeText(MyFrame)
end

DetailsEdit

Gets the visible state of an object, meaning if it's shown and all it's parents are shown aswell.

If Region:Hide() is called on a frame, then all of it's children are hidden also. In this case, its children are shown if they were prior to the Hide() call, but not visible.

FrameXML uses this in a couple of places to tell whether or not the entire UI has been hidden for screenshot purposes (visible is false while shown is true)

See alsoEdit