From 901cea3b8997af5f3b582a0a5634d6827f181fec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Qui=C3=B1ones?= Date: Fri, 16 Oct 2026 15:30:28 -0300 Subject: [PATCH] Touch: Allow scrolling credits with touch and drag --- scenes/menus/title/components/credits.gd | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scenes/menus/title/components/credits.gd b/scenes/menus/title/components/credits.gd index f55308327..8aed8d47d 100644 --- a/scenes/menus/title/components/credits.gd +++ b/scenes/menus/title/components/credits.gd @@ -24,7 +24,8 @@ var _current_scroll_pos: float = 0.0 func _ready() -> void: - # On touchscreens, there is a touch button to go back. + # On touchscreens, there is a touch button to go back, and the credits + # scroll by dragging. if DisplayServer.is_touchscreen_available(): hints_container.hide() @@ -66,6 +67,15 @@ func _input(event: InputEvent) -> void: _current_scroll_pos = scroll_container.scroll_vertical return + # Dragging a finger scrolls the credits along with it, and stops the + # auto-scroll like the mouse wheel does. + if event is InputEventScreenDrag: + _is_auto_scrolling = false + _current_scroll_pos = clampf( + _current_scroll_pos - event.relative.y, 0.0, scroll_content.size.y + ) + return + _input_axis = Input.get_axis("move_up", "move_down") if is_zero_approx(_input_axis): _input_axis = Input.get_axis("ui_up", "ui_down")