Here is a draw method we can use in LibGDX:
spriteBatch.draw(texture, x, y, width, height, u, v, u2, v2);
I wanted to make a background draw more than once. I mean, the player will move and background will not, but instead a new image will be drawn when the first one’s borders are on the screen.
I could do it with this method. But I am curious, because I couldn’t really understand what it does. My background image is a 128x128 one, and it is drawn 4 times on the screen. I can manipulate u, v, u2 and v2 values and make it draw once or twice. But I really don’t know which one to manipulate to get the results I want.
I have no particular result I want to get, I just want to know what the values in this constructor do. I especially want to know what u, v, u2 and v2 does. Searched the internet, everybody just gave the OPs numbers instead of an explanation. I need explanations.