Tilemap: Tilemap.TilesJSON not updating properly - part 2

Bugs will be moved here once resolved.

Post » Tue Jun 23, 2015 1:05 pm

Problem Description
It's still not working as it should.

Everything is practically the same as in last bug report
https://www.scirra.com/forum/tilemap-tilemap-tilesjson-not-updating-properly_t148345

When you save a file using Tilemap.TilesJSON or Tilemap.AsJSON "c2tilemap":"data" is saving correctly (all tile ids and states).
But "width" and "height" in .TilesJSON and "w" and "h" in .AsJSON are not changing back when you scale down tilemap object which is messing up the placement of the tiles.


This is the tilemap object
c2tilemap: true, width: 5, height: 5, data: 6x-1,3x0,2x-1,3x0,2x-1,3x0,6x-1 (5x5 squares with tiles in the middle)
Image

Same tilemap object after adding some empty tiles to the right (scaling up the "width")
c2tilemap: true, width: 9, height: 5, data: 10x-1,3x0,6x-1,3x0,6x-1,3x0,14x-1 (notice "width" have changed from 5 to 9)
Image

Now scaling this object down, back to 5x5 and saving it gives you this:
c2tilemap: true, width: 9, height: 5, data: 6x-1,3x0,2x-1,3x0,2x-1,3x0,6x-1 - data is exactly the same as in first image, but width is still 9 instead of 5.

And this is how it looks when you load it back to the 5x5 tilemap.
Image

All tiles placement is messed up and shifted. Most of the tiles are behind the edge of the Tilemap object, so you have to scale it up again to see rest of the tiles (image below).

(This is how it looks fully when you add some more empty tiles around.)
Image



Same file
https://dl.dropboxusercontent.com/u/343 ... pJSON.capx
ImageImageImageImage
B
157
S
66
G
42
Posts: 2,603
Reputation: 35,343

Post » Wed Jul 01, 2015 2:37 pm

Oops. Thanks, should be fixed in the next build.
Scirra Founder
B
398
S
236
G
88
Posts: 24,428
Reputation: 194,625


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 7 guests