Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function generateQuads(atlas, tilewidth, tileheight)
- local sheetWidth = atlas:getWidth()/tilewidth
- local sheetHeight = atlas:getHeight()/tileheight
- local sheetCounter = 1
- local quads = {}
- for y = 0, sheetHeight - 1 do
- for x = 0, sheetWidth - 1 do
- quads[sheetCounter] = love.graphics.newQuad(x*tilewidth, y*tileheight, tilewidth, tileheight, atlas:getDimentions())
- following the declaration of the quad
- end
- end
- return quads
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement