FR/GuiSetVisible

From Multi Theft Auto: Wiki
Jump to: navigation, search

Cette fonction change l’état du GUI en visible ou invisible.

Syntax

bool guiSetVisible ( element guiElement, bool state )

Arguments

  • guiElement: Le GUI que vous souhaitez rendre visible/invisible.
  • state: Status (true = visible/ false = invisible)

Retour

Retourne true si l’élément a été changé, false le contraire.

Exemple

This example creates a gui window and changes its visibility every 2 seconds, infinite times. Cette exemple crée une fenêtre et change son status toute les 2 secondes, temps infini.

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

--Create a gui window called 'myWindow'
myWindow = guiCreateWindow ( 0.3, 0.3, 0.5, 0.60, "GUI window title", true )
--Set a timer to change the window's visibility every 2 seconds, infinite times
setTimer ( changeVisibility, 2000, 0 )

See Also

General functions

FROM VERSION 1.5.6 r16361 ONWARDS

Browsers

Buttons

Checkboxes

Comboboxes

Edit Boxes

Gridlists

FROM VERSION 1.5.6 r16204 ONWARDS

Memos

Progressbars

Radio Buttons

Scrollbars

Scrollpanes

Static Images

Tab Panels

Tabs

Text Labels

Windows