Skip to content

Tileset with gaps produces incorrect .json #1371

@Christian-Broomfield

Description

@Christian-Broomfield

Original issue filed in Tiled: mapeditor/tiled#831

Project used to reproduce problem described below: https://github.com/SoulBeaver/broken-tiled-tilemap2

Tiled screen:

Tiled screen of tilemap

Rendering using phaser-tiled plugin:

Rendering tilemap using phaser-tiled plugin

Rendering using vanilla phaser:

Rendering tilemap using vanilla phaser

The .json for this tilemap

It turns out that Tiled has the correct ids in the tile layer, but Phaser is displaying an incorrect sprite.

Example:

The first tile in the tilemap is a corner bush with id 857; the tiled .json has 858, which is okay because the firstgid is 1. Phaser instead renders the broken bush, which is 842. We're off by 15. This makes my previous assessment of phaser missing one index per row. The bush in the tilemap is in the 15th row, so we've omitted 15 IDs.

I also have a second project in TypeScript using a smaller Tilemap.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions