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
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -108,9 +108,11 @@ if Input.is_action_just_pressed("reload_scene"):
108
108
```
109
109
Don't forget to add key/mouse/controller mapping for the "reload_scene" action ;)
110
110
111
-
### Tile layer z index
111
+
### Z index for tile layer and single tile
112
112
113
-
Can set the z-index for the tilelayer by adding a custom property `z_index`, this will set the z-index of the tile layer in the scene file.
113
+
You can set the z-index for the whole tilelayer by adding a custom property `z_index`. This will set the z-index of the tile layer in the scene file.
114
+
115
+
You can also set the z-index for tiles in a tileset by adding a custom float property `godot:z_index` to the tile. This is stored in the exported tileset file.
Copy file name to clipboardExpand all lines: export_to_godot_tileset.js
+9-3Lines changed: 9 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,7 @@ class GodotTilesetExporter {
14
14
this.shapesResources="";
15
15
this.shapes="";
16
16
this.navpolyMap=[];
17
+
this.zIndexMap=[];
17
18
this.firstShapeID="0";
18
19
};
19
20
@@ -52,6 +53,13 @@ class GodotTilesetExporter {
52
53
autotileCoordinates.y+=1;
53
54
}
54
55
56
+
constzIndex=tile.property('godot:z_index');
57
+
if(zIndex!==undefined){
58
+
constzIndexFloat=parseFloat(zIndex);
59
+
if(isNaN(zIndexFloat))tiled.warn(`Skipping export of godot:z_index on tile with id ${tile.id} because it can not be converted to float. value: ${zIndex}`);
0 commit comments