From 5f0e0ce205b5f4cf096d947054fb7aae35962f51 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Mon, 25 Nov 2024 21:04:29 +0100 Subject: [PATCH] Improve GUI in 3D demo (#1140) - Increase physics ticks per second to 120, so that UI interactions feel smoother and have lower input lag. This happens since input is governed by the physics tick due to the use of physics picking. - Add a placeholder to the LineEdit and select a default option in the OptionButton. --- viewport/gui_in_3d/gui_panel_3d.tscn | 4 +++- viewport/gui_in_3d/project.godot | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/viewport/gui_in_3d/gui_panel_3d.tscn b/viewport/gui_in_3d/gui_panel_3d.tscn index 2600b28c..c8b2f8b5 100644 --- a/viewport/gui_in_3d/gui_panel_3d.tscn +++ b/viewport/gui_in_3d/gui_panel_3d.tscn @@ -59,8 +59,9 @@ horizontal_alignment = 1 layout_mode = 2 text = "A button!" -[node name="TextEdit" type="LineEdit" parent="SubViewport/GUI/Panel/VBoxContainer"] +[node name="LineEdit" type="LineEdit" parent="SubViewport/GUI/Panel/VBoxContainer"] layout_mode = 2 +placeholder_text = "Enter text here..." [node name="HSlider" type="HSlider" parent="SubViewport/GUI/Panel/VBoxContainer"] layout_mode = 2 @@ -119,6 +120,7 @@ offset_right = -39.0 offset_bottom = -147.0 grow_horizontal = 0 grow_vertical = 0 +selected = 0 item_count = 3 popup/item_0/text = "Item 0" popup/item_1/text = "Item 1" diff --git a/viewport/gui_in_3d/project.godot b/viewport/gui_in_3d/project.godot index 9b7a07a0..fa27ae42 100644 --- a/viewport/gui_in_3d/project.godot +++ b/viewport/gui_in_3d/project.godot @@ -30,6 +30,10 @@ theme/default_theme_scale=2.0 3d_physics/layer_2="Control" +[physics] + +common/physics_ticks_per_second=120 + [rendering] renderer/rendering_method="gl_compatibility"