Skip to content

Tileset with spacing causes size mismatch error #297

@bowlercaptain

Description

@bowlercaptain

using a spritesheet with a single pixel of spacing, the inspector shows size mismatch errors. Instead, we should read the number of pixels from the tileset:

<tileset [...] spacing="1" [...]>

and use it to offset our pixel destinations by index * spacing and expect an additional final width/height of spacing * length in each dimension.

Error copy:

SuperTiled2Unity version: unknown, Unity version: 6000.1.14f1
Errors Detected. Your Tiled asset may not function correctly. Please follow directions to fix.
Mismatched Texture Sizes
Expected texture size: 203x186
Actual texture size: 256x128
Check import settings for 'tilemap.png'.
Max Size may be too small.

repro .tsx, which assumes it's in a single folder under assets (Assets/tiled, for example), and tilemap.png is in Assets/graphics/kenney_tiny-town/Tilemap/:

Kenney Tiny with spacing.txt

repro png (cc0)

Image

I assume the new version of unity is not the cause of the problem, unless we're branching around this code with a whitelist instead of a blacklist for some reason.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions