varshow=false;
vartext="text";
varcolor=Color.white;
varinteger:=0;
varfloat_value:=0.2;
varoption=0;
func_ready():
#By default all Controls have no size_flags#and all Buttons have action_mode set to ACTION_MODE_BUTTON_PRESS.#You can clear all default values by calling GUI.clear_default();#And you can set your own default values.#Call this to make all buttons flat by defaultGUI.add_default(Button, "flat", true);
#Call this to remove default value "flat" from all ButtonsGUI.remove_default(Button, "flat");
func_gui(delta):
#LabelGUI.label(str("FPS: ", Engine.get_frames_per_second()));
#ButtonifGUI.button("button"):
print("Button clicked");
ifGUI.buttonpress("buttonpress"):
GUI.label("Button continuously pressed");
#Toggleshow=GUI.toggle("toggle", show);
ifshow:
GUI.label("Toggle on");
#Boxes - VBoxContainer, HBoxContainer, GridContainer...GUI.hbox();
foriin3:
ifGUI.button(str("button ", i)):
print("Button ", i, " pressed");
GUI.end();
#LineEdittext=GUI.line(text);
#Colorcolor=GUI.pickcolor(color);
#SpinBoxinteger=GUI.spin(integer, 0, 20);
float_value=GUI.spin(float_value, 0.0, 1.0);
#Optionsoption=GUI.options(option, ["option 1", "option 2", "option 3"]);
#Progress barGUI.property.rect_min_size=Vector2(200, 0);
GUI.progress(float_value);
#TooltipGUI.property.rect_min_size=Vector2(200, 0);
GUI.property.hint_tooltip="Tooltip";
GUI.button("Button with tooltip");