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
does not take into account multiple tilesets so "- 1" is accurate only for the first tileset. In other cases we need to offset it by firstGID field of the appropriate tileset instead. The code I came up with is (replacing the line above):
// find proper tileset for this gid
var firstGID = 1;
for (t in map.tilesets)
if (gid >= t.firstGID)
firstGID = t.firstGID;
gid -= firstGID;
The text was updated successfully, but these errors were encountered:
Yeah, multiple tilesets should have better support. I haven't looked into it fully but aren't there cases where map.tilesets need to be populated with the actual bitmap data? Maybe that's just related to width/height.
In rder for this to work correcty, yes, tileset need to have its image loaded, i have done that and, thanks to it, i made the map to autoload layers and even object layer with images, i used TiledImage for that, using the tileset.image and the getRect method, its working even when map hast multiple tilesets.
Line 53:
gid = layer.tileGIDs[row][col] - 1;
does not take into account multiple tilesets so "- 1" is accurate only for the first tileset. In other cases we need to offset it by firstGID field of the appropriate tileset instead. The code I came up with is (replacing the line above):
// find proper tileset for this gid
var firstGID = 1;
for (t in map.tilesets)
if (gid >= t.firstGID)
firstGID = t.firstGID;
gid -= firstGID;
The text was updated successfully, but these errors were encountered: