Skip to content

GDScript

Patrick Dawson edited this page Oct 27, 2024 · 6 revisions

The GDExtension offers partial bindings for GDScript, based on the official dear_bindings. If there's an ImGui feature you want which isn't available in GDScript, please submit an issue.

Function names may differ slightly from the original C++ API. A complete list is available in the Godot editor (press F1 and search for ImGui or a method name).

Where the ImGui API uses pointers to pass a single variable by reference, the GDScript bindings use one-element arrays, similar to the progress parameter in ResourceLoader.load_threaded_get_status.

For example:

var mynum := [42]

func _process(_delta):
    ImGui.Begin("window name")
    ImGui.DragInt("my number", mynum)
    ImGui.Text("number = %d" % mynum[0])
    ImGui.End()
Clone this wiki locally