WoW:API Region IsVisible: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
(Reformat, expand.)
Line 1: Line 1:
<center>'''IsVisible''' ''-Documentation by [[Kisk]]-''</center>
{{widgetmethod}}


Gets the visible state of an object.
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).


  obj:IsVisible();
  visible = MyObject:IsVisible();


----
== Returns ==
;''Arguments''


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


----
== Example ==
;''Returns''


: Boolean
  if(MyFrame:IsVisible()) then
 
  MyAddon_UpdateSomeText(MyFrame);
----
;''Example''
  if (MyFrame:IsVisible()) then
    -- Frame is visible
elseif (not MyFrame:IsVisible()) then
    -- Frame is not visible
  end
  end


;''Result''
== Details ==
: The if function fires the corresponding statements based on the boolean value returned by MyFrame:IsVisible()
 
----
;''Description''


: 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 a frame calls Hide(), then all of it's children are hidden. 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".
:The default UI 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)
----
{{Template:WoW API}}

Revision as of 15:48, 29 July 2006

Widget API ← Region < IsVisible

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).

visible = MyObject:IsVisible();

Returns

visible
Boolean - 1 (true) if the object is visible, nil (false) if not.

Example

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

Details

Gets the visible state of an object, meaning if it's shown and all it's parents are shown aswell.
If :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)