Skip to reading
GDScript Programming & Godot

Gameplay: GUIs, element state and data-driven widgets

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page
On this page

GUI targets have two levels: the interface ID and an element ID inside it. Use the interface-level commands for the whole window and element-level commands for one button, label or widget. Visual Designer preview is not the place to test event execution.

ShowGUI()#

Show Gui

Show an authored interface.

Source table from Gameplay: GUIs, element state and data-driven widgets, page 174
Option key / fieldMeaning and inputDefault
GUI guiIdChoose an authored GUI ID.Blank

Timing. Waits for the runtime routine to return; no further completion wait is promised by this schema.

Code example
await ShowGUI({"guiId": "hud"})

In use. Show a note-reading panel after the player examines a document. Check its runtime activation, layer and blocking settings. Showing it is different from enabling a disabled interface.

HideGUI()#

Hide Gui

Hide an authored interface.

Source table from Gameplay: GUIs, element state and data-driven widgets, page 174
Option key / fieldMeaning and inputDefault
GUI guiIdChoose an authored GUI ID.Blank

Timing. Waits for the runtime routine to return; no further completion wait is promised by this schema.

Code example
await HideGUI({"guiId": "hud"})

In use. Hide the note panel on its Close button. It does not erase its definition or necessarily clear the story variables behind it. If another activation rule immediately shows it again, fix that rule rather than adding repeated Hide calls.

Page 174 of 378Permalink
Go to page