Multiple tileset on the same TMX. Is it permitted?

moving forward on the costruction of an Unity3D plugin for read tmxs…
I’m trying the algorithm whit many tmx, but
I found a tmx file and I don’t know if it’s well formed or not.

The file don’t have linked tsx but some tileset declared in that way:

<tileset firstgid="1" name="tiles" tilewidth="64" tileheight="64">
  <image source="tiles.png" width="512" height="512"/>
 <tileset firstgid="65" name="tilesGreen" tilewidth="64" tileheight="64">
  <image source="tilesGreen.png" width="512" height="512"/>
 <tileset firstgid="129" name="tilesRed" tilewidth="64" tileheight="64">
  <image source="tilesRed.png" width="512" height="512"/>

Is it legal? I mean: Does Tiled can have multiple tilesets on the same tmx?

Thanks in advance.


This is perfectly fine, and it’s the whole reason why the “firstgid” attribute exists, which tells you where the tiles from each tileset start in the global tile IDs.

Thanks for the quick answer Bjorn, I’m handling tileset as array.