Advertisement
joseleeph

Untitled

Jan 5th, 2021
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. function generateQuads(atlas, tilewidth, tileheight)
  2. local sheetWidth = atlas:getWidth()/tilewidth
  3. local sheetHeight = atlas:getHeight()/tileheight
  4.  
  5. local sheetCounter = 1
  6. local quads = {}
  7. for y = 0, sheetHeight - 1 do
  8. for x = 0, sheetWidth - 1 do
  9. quads[sheetCounter] = love.graphics.newQuad(x*tilewidth, y*tileheight, tilewidth, tileheight, atlas:getDimentions())
  10. following the declaration of the quad
  11.  
  12. end
  13. end
  14. return quads
  15. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement