Hi,
I’m using libGDX and I copy/pasted some endless-scroll code that seems to work:
scrollTimer += delta;
if (scrollTimer > 1.0f)
scrollTimer = 0.0f;
sStars.setU(scrollTimer);
sStars.setU2(scrollTimer+1);
It works, but stars fly too fast. I’d like to tweak it, but I can’t find in the docs the meaning of setU and setU2. Googling around I found that it probably has got something to do with UV mapping, i.e. X and Y coordinates in texture, but I can’t figure out how it works.
In the code I copied, scrollTimer goes from 0 to 1, so setU() is called with values in interval 0-1 and setU2() is called with interval 1-2. But what does all that mean?