Search code examples
javabackgroundlibgdx

How to create a scrolling background with libGDX


I'm trying to find a better way to create a scrolling background in android studio for a game I am making. I could just load the image twice and have them scroll side by side, but I am wondering if there is a better way to do it. The background needs to be moving at a constant rate, as the character never moves from the center of the screen. The movement of the background is completely independent from everything else.


Solution

  • Better way than

    I could just load the image twice and have them scroll side by side

    until they invented.

    In this answer there is an example code.