You can use the LDtk importer in your own project by adding this project as a Defold library dependency. Open your game.project file and in the dependencies field under project add:
https://github.com/iamnabholz/defold-ldtk-importer/archive/master.zip
Or point to the ZIP file of a specific release.
Getting started with the LDtk importer is easy:
- Right click on the LDtk file on your project tree view.
- Click on
Generate Tilemapsto generate a Defold tilemap from each level of your LDtk project. - You can also generate a Lua module for each
Entity layerso you can use them in your game.
In LDtk you can create a new value that holds the path for your .tilesource file in Defold, needed for every tilemap
- Create a new
stringproperty calledtilesource, and as a value add the path for your.tilesourcefile from your project tree