TiledLib.Net
TiledLib.Net copied to clipboard
Tileset caching
I realized that external tilesets are loaded for each map separately and there is no way to cache them since in your implementation tilesets contain information about first gid. I propose changing Tileset
references in ExternalTileset to ITiIeset
and make ExternalTileset
not propagate the FirstGid
property but instead offset the gid in this[int gid]
.
Also will fork this repo and apply the second change I mentioned (without a PR) because I need this feature for GlobalGameJam which is starting "soon".
you can do caching, it would be done by passing your own loader here https://github.com/Ragath/TiledLib.Net/blob/1ee5af3b1a405dfa5effa5c2e0f09390f29774a6/TiledLib/Map.cs#L77
As for the FirstGid property, it's merely matching Tiled's behavior. But if this has changed over the years, I will implement a migration for the version change and adjust the behavior.
That's what I did, but still ExternalTileset
would propagate FirstGid
to the Tileset
and cause errors when reading the tiles.
Also as far as I understand the specification FirstGid
is a property present in the map and not the tileset
Is object rotation not supported? Or am I missing something?