Skip to reading
GDScript Programming & Godot

GetGUIProperty()

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
Code example
GetGUIProperty(gui_id: String, property_name: String, default_value: Variant = null) -> Variant

Read a whole authored GUI property.

Returns: Value or fallback.

Code example
GetGUIProperty("hud", "visible", false)

SetGUIProperty()#

Code example
SetGUIProperty(gui_id: String, property_name: String, value: Variant) -> bool

Write a supported whole-GUI property.

Returns: Boolean.

Code example
SetGUIProperty("hud", "visible", true)

GetGUIElementProperty()#

Code example
GetGUIElementProperty(gui_id: String, element_id: String, property_name: String, default_value:
Variant = null) -> Variant

Read a live authored GUI element/control property.

Returns: Value or fallback.

Code example
GetGUIElementProperty("name_entry", "name_box", "text", "")

The GUI must be built/available for a live input value. This is the text-box input route used by the tutorial.

SetGUIElementProperty()#

Code example
SetGUIElementProperty(gui_id: String, element_id: String, property_name: String, value:
Variant) -> bool

Write an authored GUI element property through the runtime manager.

Returns: Boolean.

Code example
SetGUIElementProperty("hud", "topline", "text", "Ready.")

A property update may rebuild a control. Preserve in-progress input/selection deliberately.

Page 75 of 378Permalink
Go to page