Skip to content

Commit

Permalink
Improve GUI in 3D demo (#1140)
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
Calinou authored Nov 25, 2024
1 parent 6f44371 commit 5f0e0ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion viewport/gui_in_3d/gui_panel_3d.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions viewport/gui_in_3d/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 5f0e0ce

Please sign in to comment.