Could you please tell me how to convert a ".tsx" file into a tileset in the script and add it to my map?

Could you please tell me how to convert a “.tsx” file into a tileset in the script and add it to my map?

let tileset = tiled.open("path/to/tsx");
map.addTileset(tileset);

Note that tiled.open will also open a document tab for the tileset. There is currently no way to “silently” open a tileset. It’s possible to use TilesetFormat.read(), but this creates a copy that’s disconnected from the original file, which is usually not what you want.

1 Like