I’ve been busy working with one game project where we utilize Dusk engine and Tiled. I have image layer representing the background, basically one still image. Then I place objects in corona code on top of the background etc… Basic stuff. I am using .JSON file to represent my map.
So far, I have done all development on PC environment and deployed to Android devices. All good.
Then recently, I setup my Mac to get a demo in my iOS devices but strange thing happened.
I attached two pictures to show my issue.
It looks like that objects are in their right locations in iOS as well but the background is scaled or moved.
I don’t do any modifications on the files but just build it Corona at Mac. Even the simulator shows the graphics the same way misaligned.
Have you experienced this before?
What makes this even more strange, that I have another scene which is just fine both in Windows and Mac?!?
Map that is correct has 64x43 tiles and each tile is 31x31 and background image 2000x1333
Map which misaligns has 70x54 and 31x31 tiles and background image 2168 x 1644
everything else is the same
could it be those background image aspect ratios or what could be the reason? I am lacking ideas
you know what, I got an idea while typing the problem above with that aspect ratio thing and decided to give it a test. Those problem maps had aspect ratio of 1.31 which is quite unusual. So I made a test by cutting of some unneeded area from the map to reduce it to 2000x1333 which has 1.5 aspect ratio. Reloaded that image to Tiled, exported to JSON, moved to Mac, tested in simulator and it looked great! Then build and deployed to iPad and still look nice.
I really don’t understand why iOS cares about this but at least this trick solved the problem. However, I am annoyed that I do not have real logical explanation for this
How odd… Dusk has no platform-specific code, so I was wondering if it was something with the particular image. Sounds like you got it fixed. I’ll see if I can reproduce your aspect ratio issue to see what’s going on.
you know what, I got an idea while typing the problem above with that aspect ratio thing and decided to give it a test. Those problem maps had aspect ratio of 1.31 which is quite unusual. So I made a test by cutting of some unneeded area from the map to reduce it to 2000x1333 which has 1.5 aspect ratio. Reloaded that image to Tiled, exported to JSON, moved to Mac, tested in simulator and it looked great! Then build and deployed to iPad and still look nice.
I really don’t understand why iOS cares about this but at least this trick solved the problem. However, I am annoyed that I do not have real logical explanation for this
How odd… Dusk has no platform-specific code, so I was wondering if it was something with the particular image. Sounds like you got it fixed. I’ll see if I can reproduce your aspect ratio issue to see what’s going on.