Sign up ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

How to fill region with repeated texture? Now I'm using next method:


final int tWidth = texture.getWidth();
final int tHeight = texture.getHeight();

for (int i = 0; i < regionWidth / tWidth; i++) {
    for (int k = 0; k < regionHeight / tHeight; k++) {
        spriteBatch.draw(texture, i*tWidth, k);


It's very obvious. Maybe is there any built in method?

share|improve this question

1 Answer 1

up vote 7 down vote accepted

You want to set the texture's TextureWrap setting to Repeat. See the documentation for more information, and the texture method.


setWrap(Repeat, Repeat);
share|improve this answer
Thank you very much :) –  Fox in socks Aug 20 '12 at 17:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.