-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Differences in rendering collection of images between json and lua format #12
Comments
I also ran into this. The issue is reproduced by adding images to a tileset, then removing some, then adding more, etc. This leads to non consecutive IDs for the images, and breaks your logic in For now the workaround is to recreate the tileset and only add images, never remove. If any have been removed then recreate the tileset. |
Is this just in the LUA format? Not something I use very often, but the JSON allows for removal and re-adding of tiles... I'll check into it. Maybe someone can upload a sample? |
Tha JSON format is also affected by this issue. I re-added last image Example:
Images come from https://github.com/coronalabs/Sticker-Knight-Platformer/tree/master/scene/game/img. |
Hi,
this problem is mentioned in this thread on Corona forum. I believe I find easy solution. In function gidLookup you only need to line 150:
if tonumber(k) == (gid - firstgid + 0 ) then
replace with
if (v.id or tonumber(k)) == (gid - firstgid + 0 ) then
NOTE:
I found that your solution don't work in every case since tile ids may be not consecutive numbers. Like in example below:
I first added four images to tileset and then removed 3rd image. After that I saw in Corona Simulator only two images. One image was missing. All three images were visible in Tiled Editor.
Have a nice day:)
ldurniat
The text was updated successfully, but these errors were encountered: