GuiGetVisible: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
__NOTOC__  
{{Client function}}
__NOTOC__
This function returns the visibility state of a GUI element.
This function returns the visibility state of a GUI element.


Line 15: Line 16:
==Example==  
==Example==  
<!-- Explain what the example is in a single sentance -->
<!-- Explain what the example is in a single sentance -->
This example toggles the element visibility
This example toggles the visibility of an element.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function guiToggleVisible ( guiElement )
function guiToggleVisible ( guiElement )
--we check if the gui element is visible
-- check if the gui element is visible
if ( guiGetVisible ( guiElement ) == true ) then
if ( guiGetVisible ( guiElement ) == true ) then
--if it is we hide it
-- if it is, we hide it
guiSetVisible ( guiElement, false )
guiSetVisible ( guiElement, false )
else
else
--if not, we make it visible
-- if not, we make it visible
guiSetVisible ( guiElement, true )
guiSetVisible ( guiElement, true )
end
end

Revision as of 15:06, 18 August 2007

This function returns the visibility state of a GUI element.

Syntax

bool guiGetVisible ( element guiElement )

Required Arguments

  • guiElement: the GUI element to be checked

Returns

Returns true if the element is visible, false otherwise.

Example

This example toggles the visibility of an element.

function guiToggleVisible ( guiElement )
	-- check if the gui element is visible
	if ( guiGetVisible ( guiElement ) == true ) then
		-- if it is, we hide it
		guiSetVisible ( guiElement, false )
	else
		-- if not, we make it visible
		guiSetVisible ( guiElement, true )
	end
end

See Also

General functions

Browsers

Buttons

Checkboxes

Comboboxes

Edit Boxes

Gridlists

Memos

Progressbars

Radio Buttons

Scrollbars

Scrollpanes

Static Images

Tab Panels

Tabs

Text Labels

Windows