-1

So I use a spritebatch for my tiles. I have a ground layer, object layer, and foreground layer. The ground layer and foreground layer use 1 (and the same) spritebatch that uses 1 tilesheet of scenery tiles. The object layer is for actors and obviously use a different tilesheet. The drawing order is ground, object, foreground. So if I have 1 spritebatch for the scenery and 1 for the actors I don't see how can I get this draw order seeing as I would draw the 1 spritebatch for ground and foreground together with no way to put the object spritebatch between it since it's drawn with 1 command:

love.graphics.draw(tilesetBatch);
user441521
  • 6,942
  • 23
  • 88
  • 160

1 Answers1

0

For layers to work you will need two separate sprite batches. i.e you need separate groundlayer and foregroundlayer spritebatchs.

function love.draw()
    love.graphics.draw(groundlayer)
    love.graphics.draw(objectslayer)
    love.graphics.draw(foregroundlayer)
    ...
end
Fyrn
  • 116
  • 1
  • 8