This is a plugin for Godot Engine to import
TileMap
s and TileSet
s from the Tiled Map Editor.
Simply download it from Godot Asset Library: https://godotengine.org/asset-library/asset/25.
Alternatively, download or clone this repository and copy the contents of the
addons
folder to your own project's addons
folder.
Then enable the plugin on the Project Settings.
- Import Tiled file as a Godot scene. Each layer in Tiled is a TileMap in Godot.
- Both
.tmx
(XML) and.json
formats. - Support for Base64 encoded map.
- Orthogonal and isometric maps.
- Import visibility and opacity from layers.
- Import collision/occluder/navigation shapes (based on Tiled object type).
- Custom import options, such as whether to embed the resources into the scene.
- Support for image layers
- Support for object layers, which are imported as StaticBody2D or LightOccluder2D
for shapes (depending on the
type
property) and as Sprite for tiles. - Custom properties for maps, layers, tilesets, and objects are imported as metadata.
- Support for post-import script.
- In Godot, click on menu Import -> TileMap from Tiled Editor.
- Set the source Tiled file (either a
.json
or a.tmx
). - Set the target destination scene.
- Ajusted the desired options.
- Press ok.
If no error occurs, the generated scene will be stored where you set it. The TileSets will be on a relative folder or embedded, depending on the options.
-
Godot TileSets only have on collision shape, so the last found will overwrite the others.
-
The same goes for navigation/occluder polygons.
-
There's no Ellipse shape in Godot. If you use it as a collision object, it will be converted to a capsule shape, which may be imprecise. However, if the Tiled ellipse is a perfect circle, a CircleShape2D will be used instead.
-
Set the type of the object to
navigation
oroccluder
to use it as such. -
Objects in object layer cannot be set as
navigation
. -
Only polygons can be used as occluder/navigation. For those, you can make a polygon or polyline in Tiled. Rectangles will be converted to polygons, but ellipses are not accepted.
-
Occluder shapes are set as closed if a polygon is used and as open if it is a polyline.
-
Godot has no decompression function (yet). So don't save the Tiled Map with any compressed format. "Base64 (uncompressed)" is also valid. You'll receive an error message if compressed data is detected.
The selected script will have it's post_import(scene)
method run. This
enables you to change the generated scene automatically upon each reimport.
The post_import
method will receive the built scene and must return the
changed scene.
Save all Tiled tilesets a single Godot resource. If any of your layers uses more than one tileset image, this is required otherwise it won't be generated properly.
Save all TileSets and images embedded in the target scene. Otherwise they will be saved individually in the selected relative folder.
The relative path from the target scene where to save the resources (images and tilesets).
The image flags to apply to all imported TileSet images.
When the TileSet is a collection of images, this option tells tp create a new directory with the TileSet name to hold all of the images.
Whether or not to save the custom properties as metadata in the nodes and resources.
MIT License. Copyright (c) 2016 George Marques.