diff options
author | tpart <tpart120@proton.me> | 2025-09-21 18:27:24 +0200 |
---|---|---|
committer | tpart <tpart120@proton.me> | 2025-09-21 18:27:24 +0200 |
commit | b67f66269c1ff8fd71f39622e7387ed4734ccc69 (patch) | |
tree | 58f516de6985b01c9e057a2ba4fbad28eb2116dd | |
parent | 3ce0811efce6e85d65559311d581555f486c26ad (diff) | |
download | hurrycurry-b67f66269c1ff8fd71f39622e7387ed4734ccc69.tar hurrycurry-b67f66269c1ff8fd71f39622e7387ed4734ccc69.tar.bz2 hurrycurry-b67f66269c1ff8fd71f39622e7387ed4734ccc69.tar.zst |
Refactor scroll container custom
-rw-r--r-- | client/gui/components/touch_scroll_container.gd | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/client/gui/components/touch_scroll_container.gd b/client/gui/components/touch_scroll_container.gd index c6c1393b..292d084a 100644 --- a/client/gui/components/touch_scroll_container.gd +++ b/client/gui/components/touch_scroll_container.gd @@ -18,7 +18,7 @@ class_name ScrollContainerCustom # Adds support for scrolling with joypad and touch -const SCROLL_SPEED := 1000. +const SCROLL_SPEED := 70. var velocity := 0. @export var auto_scroll_to_bottom := false @@ -35,7 +35,7 @@ func scroll_to_bottom(): func _process(delta): velocity = G.interpolate(velocity, 0., delta * 5.) - velocity = 0. if abs(velocity) < .001 else velocity + velocity = 0. if abs(velocity) < .1 else velocity if Input.get_axis("scroll_up", "scroll_down") != 0.: velocity = Input.get_axis("scroll_up", "scroll_down") set_deferred("scroll_vertical", scroll_vertical + velocity * delta * SCROLL_SPEED) @@ -43,4 +43,4 @@ func _process(delta): func _input(event): if event is InputEventScreenDrag: if Rect2(global_position, size).has_point(event.position): - velocity = -(scroll_vertical - (scroll_vertical - event.relative.y)) * .1 + velocity = -event.screen_relative.y |