Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Tiled background missalignment on iOS build
Started by tonshadow Nov 12 2015 05:01 AM

3 replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

tonshadow

[GLOBAL: userInfoPane.html]
tonshadow
  • Observer

  • 5 posts
  • Corona SDK

Hi Caleb,

 

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

 

br

Teemu

 

Attached Files



[TOPIC: post.html]
#2

Caleb P

[GLOBAL: userInfoPane.html]
Caleb P
  • Corona Geek

  • 1,424 posts
  • Corona SDK

So your background image is just a big image layer, and it works in the Corona Simulator and Android but not in Xcode simulator or iOS?

 

If so, can you please zip up the problem map and PM it to me?

 

- Caleb



[TOPIC: post.html]
#3

tonshadow

[GLOBAL: userInfoPane.html]
tonshadow
  • Observer

  • 5 posts
  • Corona SDK

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 :)

 

-T-



[TOPIC: post.html]
#4

Caleb P

[GLOBAL: userInfoPane.html]
Caleb P
  • Corona Geek

  • 1,424 posts
  • Corona SDK

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.

 

- Caleb




[topic_controls]
[/topic_controls]