java - Repeat Image along x axis in libgdx game for Android -
i implementing 1 game want repeat 1 image along x direction.i searched on web not correct approach. there grass image , want repeat along ground in x direction.
kindly provide suggestions , possible ways it.
i using following code draw image inside render method.
spritebatch.draw(grass, 0, 0);
let's try simple loop
for(int = 0; <= gdx.graphics.getwidth(); += grass.getwidth() { spritebatch.draw(grass, i, 0); }
i assume grass
is instance of sprite
. if doesn't work, don't hesitate comment back.
Comments
Post a Comment