Negative value in world offset value

Hello, i have world file looking like that:

    "patterns": [
            "regexp": "map_*(\\d+)_*(\\d+)\\.tmx",
            "multiplierX": 16,
            "multiplierY": 16,
            "offsetX": 0,
            "offsetY": 0
    "type": "world"

Problem is that my game engine renders particular chunks in different order than tiled does. Quickest fix to that problem that came to my mind is simply put negative multiplier here. Unfortunately chunks were rendered like multiplier is set to 0.
Is there any way to set multiplier to negative value? Or i’m missing something? If that’s not possible. Then consider that Question as feature request :wink:

Hey @Patryk_Gwiazdowski, welcome to the Tiled forums!

You found a bug. :slight_smile: I’ve fixed it now in the following change:

So, the problem was that the mapWidth and mapHeight attributes are defaulting to the values of the multiplierX and multiplierY respectively. This usually makes sense, but not if you’re using a negative multiplier. Now they default to the absolute value of the multiplier.

To work around this bug, you can set the mapWidth and mapHeight properties explicitly.

Btw, note that the eventual value is in pixels. As such a multiplier of 16 seems a bit on the low end. You’ll likely want to multiply this by your tile size, if your maps are 16x16 in tiles.

1 Like

Thanks for such quick response and fix!