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 grassis instance of sprite. if doesn't work, don't hesitate comment back.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -