diff options
author | tpart <tpart120@proton.me> | 2024-07-30 15:38:45 +0200 |
---|---|---|
committer | tpart <tpart120@proton.me> | 2024-07-30 15:38:45 +0200 |
commit | 4dc2cf37b414dbd080feffb115840fe6175981a6 (patch) | |
tree | 3ce6e8d16d8e2f4f06ab16d58125a98301379aa4 | |
parent | 5f1a8b6d847471bb6b8ed63585408ed7e9af2d57 (diff) | |
download | hurrycurry-4dc2cf37b414dbd080feffb115840fe6175981a6.tar hurrycurry-4dc2cf37b414dbd080feffb115840fe6175981a6.tar.bz2 hurrycurry-4dc2cf37b414dbd080feffb115840fe6175981a6.tar.zst |
Add touch scrolling suport
-rw-r--r-- | client/menu/scroll_container_custom.gd | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/client/menu/scroll_container_custom.gd b/client/menu/scroll_container_custom.gd index b8b25652..5da95ac5 100644 --- a/client/menu/scroll_container_custom.gd +++ b/client/menu/scroll_container_custom.gd @@ -21,4 +21,9 @@ class_name ScrollContainerCustom const SCROLL_SPEED := 1000. func _process(delta): - set_deferred("scroll_vertical", scroll_vertical + Input.get_axis("scroll_up", "scroll_down") * delta * SCROLL_SPEED) + if Input.get_axis("scroll_up", "scroll_down") != 0.: + set_deferred("scroll_vertical", scroll_vertical + Input.get_axis("scroll_up", "scroll_down") * delta * SCROLL_SPEED) + +func _input(event): + if event is InputEventScreenDrag: + set_deferred("scroll_vertical", scroll_vertical - event.relative.y) |