- Godot version: 3.2.3
- LDtk version: 0.5.2
Basic GDscript for importing LDtk files into the Godot game engine.
- removed import files
- The Importer is now an addon/plugin.
- added basic import options for Entities.
- Added basic functionality for autolayers and intgrid layers.
Can now create tilemaps from autolayers and intgrid layers with tilesets. Intgrid layers without tilesets are ignored currently.
- Currently this script has very basic functionality. Only Tile Layers are currently working.
- Copy the addons folder to your godot project folder.
- Enable LDtk Importer under Project Settings/Plugins.
- Add a .ldtk map file or use the example testmap.ldtk, the map will be imported as a .tscn file
- IntGrid, Tiles, and AutoLayers are imported as TileMap Nodes.
- Currently Entities have very basic functionality, checkout the testmap.ldtk for examples.
You can set up how your entities are imported:
- Create a new Entity
- Add a String Field Type
- Set the Field Identifier to:
NodeType
- Set the Default Value to the type of Node
Current node options are:
- Position2D
- Area2D
- KinematicBody2D
- RigidBody2D
- StaticBody2D
- The example is using the tileset that comes with LDtk:
Cavernas_by_Adam_Saltsman.png
- The conversion functions:
coordId_to_gridCoords(), tileId_to_gridCoords(), tileId_to_pxCoords()
are from the LDtk documentation.