Skip to content

Commit b7fe458

Browse files
authored
Fix createFromTiles to handle multiple tilesets when using sprite sheets
Fixes #7122. Properly use the starting index of the tileset while calculating the frame to be used for the sprite from the tileset image.
1 parent c62baca commit b7fe458

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tilemaps/components/CreateFromTiles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ var CreateFromTiles = function (indexes, replacements, spriteConfig, scene, came
8383
if (config.hasOwnProperty('useSpriteSheet'))
8484
{
8585
config.key = tile.tileset.image;
86-
config.frame = tile.index - 1;
86+
config.frame = tile.index - tile.tileset.firstgid;
8787
}
8888

8989
sprites.push(scene.make.sprite(config));

0 commit comments

Comments
 (0)