Cartographer is a small library for loading and drawing Tiled maps in LÖVE.
To use Cartographer, place cartographer.lua in your project, and then add this code to your main.lua:
cartographer = require 'cartographer' -- if your cartographer.lua is in the root directory
cartographer = require 'path.to.cartographer' -- if it's in subfolders
map = cartographer.load(path)
Loads a Tiled map in Lua format.
path
- the path to the map to load.
map:draw()
map:update(dt)
You only need to do this if your map has animated tiles.
map.layers[name]
While you can access layers by numerical index as usual, Cartographer allows you to access layers by name as well.
map.layers[name]:draw()