Search code examples
androidlibgdx

Libgdx - shop scrolling


I'm looking for examples to how a shop like in color switch or any other game is made. That you can scroll and if you scroll faster it goes faster, and I have a slight idea that I could calculate this with distance of touch / time, but I like the effect that you can go beyond, but it flicks you back. Or was actually wondering if something like this, which is needed a lot, is already made somewhere in a library?


Solution

  • My best recommendation would be to use the built-in ScrollPane class along with the other Scene2d.ui components for structuring such a shop window.

    Documentation: https://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/scenes/scene2d/ui/ScrollPane.html