phaser-ce icon indicating copy to clipboard operation
phaser-ce copied to clipboard

parseTiledJSON error when using Tiled "Collection of images" tileset.

Open Boggartmob opened this issue 7 years ago • 7 comments

In this case map.tiles is empty because there is no tileset image and each tile has it's own. Code crashes at sid = map.tiles[tile.index][2];

in the same time map.imagecollections is ok.

"tilesets":[
        {
         "columns":0,
         "firstgid":1,
         "grid":
            {
             "height":1,
             "orientation":"orthogonal",
             "width":1
            },
         "margin":0,
         "name":"test",
         "spacing":0,
         "tilecount":7,
         "tileheight":302,
         "tiles":
            {
             "0":
                {
                 "image":"chest.png",
                 "imageheight":200,
                 "imagewidth":200
                },
             "2":
                {
                 "image":"coopers.png",
                 "imageheight":172,
                 "imagewidth":222
                }
            }
      }
]

Boggartmob avatar Aug 26 '17 09:08 Boggartmob

Thanks. What's the error message? Did it ever work in a previous Phaser version?

samme avatar Aug 26 '17 16:08 samme

@samme error message is Cannot read property '2' of undefined in line i described above.

Boggartmob avatar Aug 27 '17 08:08 Boggartmob

Also what exactly is a "Collection of images" tileset?

samme avatar Aug 27 '17 16:08 samme

I guess we don't support a "Collection of images" type.

I can add a warning message.

samme avatar Aug 31 '17 00:08 samme

@samme you are right. Is this hard to support that kind of tilesets?

Boggartmob avatar Sep 01 '17 07:09 Boggartmob

I'm not sure how much work it would be to add it. Hopefully someone with some knowledge can pick it up.

samme avatar Sep 02 '17 19:09 samme

I have the same issue. I'm going to try develop the missing part of the code and if I make a good stuff I will push my work (not sure because I just start learning javascript).

caronpe avatar Dec 12 '17 19:12 caronpe