You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+31-10
Original file line number
Diff line number
Diff line change
@@ -57,21 +57,42 @@ If you prefer watching check the video in YouTube:
57
57
58
58
[How to export from Tiled To Godot 3.2](https://youtu.be/4jSFAXIa_Lo)
59
59
60
+
The exporter needs to know how to set resource paths correctly for Godot before exporting. There are several ways to do this:
61
+
62
+
- If your Tiled files exist in your Godot project structure alongside the exported files, the exporter can automatically determine the resource paths. There is also the option to use the `projectRoot` custom property if needed.
63
+
- If your Tiled files exist outside your Godot project structure, you will need to set the `relativePath` custom property so the exporter can determine resource paths.
64
+
65
+
**_!!! Pay attention to the "/" instead of standard windows "\\". Single Backslash "\\" is used for escaping special symbols._**
66
+
67
+
### Setting relativePath
68
+
69
+
The custom property `relativePath : string` contains the relative path to the exported files from the Godot project root.
70
+
The value of `relativePath` is transformed to a resource path which Godot uses.
71
+
72
+
* When placed on a Tiled TileMap (.tmx) object, it will define where the Tileset objects (.tres) are located in the exported TileMap (.tscn).
73
+
* When placed on a Tiled TileSet (.tsx) object, it will define where the Image is located in the exported TileMap (.tres).
74
+
75
+
Example:
76
+
If the location of an exported tileset is: `C:/project/maps/level1/tileset.tres`
77
+
Then the `relativePath` custom property would be: `/maps/level1`
78
+
60
79
### Setting projectRoot `res://`
61
80
62
-
The exporter needs to know where `res://` is. By default, it's in the same directory where the Tiled files are being saved.
63
-
You can override this path with a custom property `projectRoot : string` that is either relative to the file you are exporting (starting with a `.`), or absolute path,
64
-
Either way the value of projectRoot is transformed to a resource path which Godot use.
81
+
The exporter needs to know where `res://` is so when you export to a subfolder in your Godot project all the relative paths for the resources `(res://)` are set correctly and relative to the project root. `res://` is equivalent to the location of `project.godot` in your Godot project.
82
+
83
+
**By default, the exporter expects the Tiled files to be saved in a subfolder of your Godot project next to the exported files and will determine the project root automatically. Setting `projectRoot` is no longer required in this scenario.**
84
+
85
+
If needed, you can override this path with a custom property `projectRoot : string` that is either relative to the file you are exporting (starting with a `.`) or an absolute path.
86
+
Either way, the value of `projectRoot` is transformed to the `res://` resource path which Godot uses and should be equivalent to the location of `project.godot`.
65
87
66
-
* When placed on a Tiled TileMap (.tmx) object it will define where the Tileset objects (.tres) are located in the exported TileMap (.tscn).
67
-
* When placed on a Tiled TileSet (.tsx) object it will define where the Image is located in the exported TileMap (.tres).
88
+
* When placed on a Tiled TileMap (.tmx) object it will be used as the root to determine the relative resource path to the Tileset objects (.tres) used in the exported TileMap (.tscn).
89
+
* When placed on a Tiled TileSet (.tsx) object it will be used as the root to determine the relative resource path to the Image used in the exported TileMap (.tres).
68
90
69
-
**_!!! Pay attention to the "/" instead of standard windows "\\".
70
-
Single Backslash "\\" is used for escaping special symbols._**
91
+
Example:
92
+
If the location of an exported tileset is: `C:/project/maps/level1/tileset.tres`
93
+
Then the `projectRoot` custom property would be: `C:/project`
71
94
72
-
This is needed so when you export to a subfolder in your Godot project all the relative
73
-
paths for the resources `(res://)` are set correctly and relative to the custom property
74
-
you've added `"projectRoot"`;
95
+
### Exporting to Godot
75
96
76
97
If everything is fine when you go to _File -> Export As_, a new option should exist:
0 commit comments