DgsGetVisible: Difference between revisions
Jump to navigation
Jump to search
m (Thisdp moved page DgsDxGUIGetVisible to DgsGetVisible) |
m (DGS OOP Syntax changing) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 5: | Line 5: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool | bool dgsGetVisible ( element guiElement ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{DGS/OOP| | |||
Method = DGSElement:getVisible| | |||
Variable = visible|dgsSetVisible | |||
}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
Line 20: | Line 24: | ||
function guiToggleVisible ( ) | function guiToggleVisible ( ) | ||
if ( DGS: | if ( DGS:dgsGetVisible ( myWindow ) == true ) then -- check if the dgs element is visible | ||
DGS: | DGS:dgsSetVisible ( myWindow, false ) -- if it is, we hide it | ||
else | else | ||
DGS: | DGS:dgsSetVisible ( myWindow, true ) -- if not, we make it visible | ||
end | end | ||
end | end | ||
myWindow = DGS: | 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</syntaxhighlight> | bindKey ( "space", "down", guiToggleVisible ) --bind the player's spacebar to the function guiToggleVisible</syntaxhighlight> | ||
=See Also= | |||
{{ | |||
==<span style="color:#eb3f00;text-shadow:0.05em 0.05em 0.2em #00000099;">General Functions</span>== | |||
{{DGS General Functions}} | |||
==<span style="color:#eb3f00;text-shadow:0.05em 0.05em 0.2em #00000099;">General Events</span>== | |||
{{DGS Events/General}} |
Latest revision as of 21:08, 3 May 2021
This function determines if a DGS element is visible.
Syntax
bool dgsGetVisible ( element guiElement )
DGS OOP Syntax Help! I don't understand this!
- Method: DGSElement:getVisible(...)
- Variable: .visible
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
General Functions
- dgsGetPosition
- dgsSetPosition
- dgsSetParent
- dgsGetParent
- dgsGetChild
- dgsGetChildren
- dgsGetSize
- dgsSetSize
- dgsGetType
- dgsSetLayer
- dgsGetLayer
- dgsSetCurrentLayerIndex
- dgsGetCurrentLayerIndex
- dgsGetLayerElements
- dgsGetProperty
- dgsSetProperty
- dgsSetPropertyInherit
- dgsGetProperties
- dgsSetProperties
- dgsGetVisible
- dgsSetVisible
- dgsGetEnabled
- dgsSetEnabled
- dgsGetPositionAlignment
- dgsSetPositionAlignment
- dgsGetAlpha
- dgsSetAlpha
- dgsGetFont
- dgsSetFont
- dgsGetText
- dgsSetText
- dgsGetPostGUI
- dgsSetPostGUI
- dgsGetInputEnabled
- dgsSetInputEnabled
- dgsGetInputMode
- dgsSetInputMode
- dgsAttachToAutoDestroy
- dgsDetachFromAutoDestroy
- dgsFocus
- dgsBlur
- dgsCreateFont
- dgsBringToFront
- dgsMoveToBack
- dgsGetScreenSize
- dgsGetCursorPosition
- dgsGetMouseEnterGUI
- dgsGetMouseLeaveGUI
- dgsIsMouseWithinGUI
- dgsSetSystemFont
- dgsGetSystemFont
- dgsGetElementsInLayer
- dgsGetElementsFromResource
- dgsGetFocusedGUI
- dgsImportFunction
- dgsImportOOPClass
- dgsG2DLoadHooker
- dgsSetRenderSetting
- dgsGetRenderSetting
- dgsSimulateClick
- dgsGetRootElement
- dgsAddMoveHandler
- dgsRemoveMoveHandler
- dgsIsMoveHandled
- dgsAddSizeHandler
- dgsRemoveSizeHandler
- dgsIsSizeHandled
- dgsAttachElements
- dgsDetachElements
- dgsElementIsAttached
- dgsAddPropertyListener
- dgsRemovePropertyListener
- dgsGetListenedProperties
- dgsSetMultiClickInterval
- dgsGetMultiClickInterval
- dgsSetMouseStayDelay
- dgsGetMouseStayDelay
- dgsCenterElement
- dgsSetElementKeeperEnabled
- dgsGetElementKeeperEnabled
- dgsSetClickingSound
- dgsGetClickingSound
- dgsSetClickingSoundVolume
- dgsGetClickingSoundVolume
General Events
- onDgsBlur
- onDgsCreate
- onDgsCursorTypeChange
- onDgsCursorStateChange
- onDgsDestroy
- onDgsElementRender
- onDgsElementMove
- onDgsElementSize
- onDgsElementEnter
- onDgsElementLeave
- onDgsFocus
- onDgsKey
- onDgsPositionChange
- onDgsPreRender
- onDgsRender
- onDgsElementScroll
- onDgsSizeChange
- onDgsTextChange
- onDgsWindowClose
- onDgsPropertyChange