0 votes

the default speed of scroll containers scrolling is too speedy and sensitive,
how can I set scroll speed manually...?

in Engine by (36 points)

2 Answers

0 votes
Best answer

i found the answer my self... here help yourself....

extends ScrollContainer

var endpoint: int
var start
point: int
var relative: int
onready var tween = get_node("Tween")

func input(event):
if event is InputEventScreenTouch:
if event.pressed == true:
pass
elif event.pressed == false:
end
point = self.getvscroll()
if relative <0 and relative <= -10: start_point = end_point + relative * -10 elif relative > 0 and relative >= 10:
startpoint = endpoint - relative * 10
else:
startpoint = endpoint
self.setvscroll(endpoint)
tween.interpolate
property(self,"scrollvertical",endpoint,startpoint,.3,Tween.TRANSCUBIC,Tween.EASEOUT)
tween.start()
if event is InputEventScreenDrag:
relative = event.get
relative().y

by (36 points)
0 votes

It looks like a ScrollContainer uses a ScrollBar (VScrollBar and HScrollBar) when needing to move the contents of the container vertically and horizontally. It looks like the custom_step property is used when moving the scroll bars. Maybe that will help you with controlling the speed of scrolling?

by (1,940 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.

Categories