Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion scenes/menus/title/components/credits.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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")
Expand Down
Loading