0 votes

Hi there. I'd like to have the ItemList scrollable by touch (specifically on Android), similar to using a ScrollContainer. So it would allow me to scroll by touch, and also select an item by touch, as per common on Android with lists of items.

Any ideas?

I thought of:
1. Extending ItemList, handling touch input events, and scrolling the ItemList in response. Couple of problems: I can't see how to scroll it programmatically, and how to remove the scroll bar.
2. edit: removed
edit: 3. Add items (e.g. TextureFrame, Label) to ScrollContainer, and somehow bypass input events on these items if they are DRAG events, allowing ScrollContainer to process those, and the items only process 'press' type events.

(Bonus points for swiping an item out of the list, although I can see this being a custom control).

in Engine by (722 points)
edited by

1 Answer

+3 votes

Obviously the best solution would be to have support for Android functions like swipe, tilt and shake by the engine.
But as a workaround ... how about an invisible HSlider or VSlider in a huge or corresponding size or scale and then adding a function for signal value_changed and check at least 2 or 3 calls to find out that it goes to the same direction and how fast it is moved.
That would be the input solution as I did it. For the positioning solution maybe a viewport or camera2D is necessary?

by (78 points)
edited by

You mean like an area on a value changed buttons and swipe on it for getting the value?

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 Frequently asked questions and 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 [email protected] with your username.