WoW:API Region IsVisible: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(Reformat, expand.)
m (Move page script moved page API Region IsVisible to API Region IsVisible without leaving a redirect)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{widgetmethod}}
{{widgetmethod}}


Return whether or not an object is actually visible on-screen (ignoring the possibility that the object could be dragged off the edge of the screen).
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();
  visible = MyObject:IsVisible();
Line 7: Line 7:
== Returns ==
== Returns ==


:;visible: [[Boolean]] - 1 (true) if the object is visible, nil (false) if not.
:;visible: [[boolean]] - true if the object is visible


== Example ==
== Example ==


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


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


: Gets the visible state of an object, meaning if it's shown and all it's parents are shown aswell.
If {{api|Region:Hide|t=w}}() 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.


: If [[API Region Hide|: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)
: [[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 also ==
* {{api|Region:IsShown|t=w}}

Latest revision as of 04:47, 15 August 2023

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();

Returns[edit]

visible
boolean - true if the object is visible

Example[edit]

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

Details[edit]

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 also[edit]