SpyrexDE / SmoothScroll

Addon for the Godot Game Engine that adds a SmoothScrollContainer.
https://spyrexde.github.io/SmoothScroll/
MIT License
144 stars 13 forks source link

Make scrollbars squeeze on overdrag #19

Open SpyrexDE opened 1 year ago

SpyrexDE commented 1 year ago

Can be seen on this site: https://idiotwu.github.io/smooth-scrollbar/

SpyrexDE commented 1 year ago

I already tried some things but I could not find a good solution without too many workarounds. Maybe you find something, @HaroldLever?

HaroldLever commented 1 year ago

@SpyrexDE Sorry for replying late, busy about Game Jam these days.

I think you can get_h/v_scrollbar and change its Page value to makes it looks like squeezing.

SpyrexDE commented 1 year ago

Yeah, I already had to experience that my self when experimenting. The only way I see to achieve this effect using Godot's scroll bar is by hiding the real scroll bar and creating a new fake scrollcontainer above the real one. Then the position and size of the bar gets synchronized and when there is some overdrag, the size of the overlaying scroll container gets enlarged which results in a smaller scroll bar. It's a workaround but still uses Godot's scroll bars so I think it's the best solution. What do you think?

HaroldLever commented 1 year ago

That sounds practicable, it worths a try. Looking forwad the final effect.