DgsGetVisible

From Multi Theft Auto: Wiki

This function determines if a DGS element is visible.

Syntax

bool dgsGetVisible ( element guiElement )

Required Arguments

  • guiElement: the DGS element to be checked

Returns

Returns true if the element is visible, false otherwise.

Example

This example toggles the visibility of myWindow.

DGS = exports.dgs

function guiToggleVisible ( )        
        if ( DGS:dgsGetVisible ( myWindow ) == true ) then -- check if the dgs element is visible               
                DGS:dgsSetVisible ( myWindow, false ) -- if it is, we hide it
        else              
                DGS:dgsSetVisible ( myWindow, true ) -- if not, we make it visible
        end
end

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

See Also

Multi Language Supports

Animation

3D Interface

3D Text

Arrow List

Browser

Button

Check Box

Combo Box

Edit

Ellipse Detect Area

Detect Area

Grid List

Image

Memo

Label

Progress Bar

Radio Button

Scroll Bar

Scroll Pane

Switch Button

Tab Panel

Window

Plugin

Media Browser

Rounded Rectangle

Color Picker

Blur Box

Effect 3D