Kadoba / Advanced-Tiled-Loader

Imports Tiled maps into Lua for the LÖVE game engine. (NO LONGER IN DEVELOPMENT)
183 stars 30 forks source link

issue with TileLayer:draw() #19

Closed eipporko closed 12 years ago

eipporko commented 12 years ago

Hi, I am using your framework and it seems very useful, though I have some problems. I would like to draw my entities (player, enemies) between two layers using TileLayer:draw() method in this manner:

But it does not appear to be working

Kadoba commented 12 years ago

Try calling Map:_updateTileRange() before drawing. Although the intended way to accomplish what you're trying to do is use CustomLayers and draw the map normally.

-- Create a new custom layer and place it behind the ground layer
local entityLayer = map:newCustomLayer("Entities", map:layerPosition("Ground") + 1)

-- Define the layer draw function
function entityLayer:draw()
  -- Draw entities
end

-- Draw the map
function love.draw()
   map:draw()
end
eipporko commented 12 years ago

Thanks a lot, works fine in either of the two ways.

Kadoba commented 12 years ago

Great. I'm going to close the issue then. Let me know if you have any more trouble.