GuiGetVisible

From Multi Theft Auto: Wiki
Revision as of 04:14, 8 October 2007 by Ransom (talk | contribs) (→‎Example)
Jump to navigation Jump to search

This function determines if a GUI element is visible.

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

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

myWindow = guiCreateWindow ( 0, 0, .5, .5, "my window", true ) -- Create the gui window
bindKey ( "space", "down", guiToggleVisible ) --bind the player's spacebar to the function guiToggleVisible

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