Advertisement
Guest User

Untitled

a guest
Feb 2nd, 2014
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. for(int width = 0; width < mapWidth; width += 32)
  2. {
  3. if(width > camera.position.x - 380 && width < camera.position.x + camera.viewportWidth)
  4. {
  5. for(int height = 0; height < mapHeight; height += 32)
  6. {
  7. if(height > camera.position.y - 250 && height < camera.position.y + camera.viewportHeight)
  8. {
  9. batch.draw(bgLayer.getCell((int) (width / bgLayer.getTileWidth()), (int) (height / bgLayer.getTileHeight())).getTile().getTextureRegion(), width, height, 32, 32);
  10. }
  11. }
  12. }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement