Skip to main content

Bindings

The core addon includes a few small “driven” UI scripts you can attach directly to common UI controls to keep them synced with variables.

Basic usage

  1. Add the UI control (CheckBox, Slider, Label, ColorPickerButton, …).
  2. Attach the matching script from addons/godot_meds_core/scripts/ui/.
  3. In the Inspector, assign the exported *Variable resource.

Included bindings

ScriptAttach toExported propertySync behavior
addons/godot_meds_core/scripts/ui/bool-driven-checkbox.gdCheckBoxbool_var: BoolVariableTwo-way: checkbox toggles update the variable, and variable changes update the checkbox.
addons/godot_meds_core/scripts/ui/float-driven-slider.gdSliderfloat_variable: FloatVariableTwo-way: slider changes update the variable, and variable changes update the slider.
addons/godot_meds_core/scripts/ui/string-driven-label.gdLabelstring_variable: StringVariableOne-way: variable changes update the label text.
addons/godot_meds_core/scripts/ui/float-driven-label.gdLabelfloat_variable: FloatVariableOne-way: variable changes update the label text (via str(...)).
addons/godot_meds_core/scripts/ui/color-driven-color-picker.gdColorPickerButtoncolor_variable: ColorVariableTwo-way: picker changes update the variable, and variable changes update the picker.

Notes:

  • These scripts assume the exported variable is assigned (otherwise you’ll hit null errors at runtime).
  • “Two-way” bindings use set_value(..., self) so the variable can track the change source.