Hello Guest

Author Topic: Help with mobile device resolutions  (Read 3622 times)

kronar

  • Newbie
  • *
  • Posts: 2
    • View Profile
Help with mobile device resolutions
« on: April 11, 2013, 08:35:43 pm »
tk2D noob here. Say I work with a tk2d camera native resolution of 768x1024. I position a 32x32 pixel tk2d sprite (center anchored) at 0,0. I then animate that sprite by moving it to position 768,1024. This is all works great on an iPad 2. Now I would like to run the same project on an android device with a resolution of 720x1280. What do I need to do so that the animation plays and looks exactly the same as in the iPad 2? 

I tried implementing a camera override which has a width of 720, height of 1280, tried every 'Auto Scale' option and different 'Fit Modes' but none produced the effect I wanted. Do I need to manually scale the positions of my sprite every time I modify them?

Thanks.

 

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Help with mobile device resolutions
« Reply #1 on: April 12, 2013, 12:10:17 am »
What do you want it to do exactly? Since the resolutions and aspect ratios are different, there obviously isn't a way to do the same thing and have it behave exactly the same in any case unless
1. You want to have letterboxed screen - use fit visible, and letterbox the parts of the screen that overshoot.
2. You use the stretchToFill override. This will end up with non-square pixels, but everything will just be scaled to fit...
3. You change your code to move further.

Ultimately it depends very much on your needs. I'll be happy to elaborate further, but I will need to know what your needs are first.

kronar

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Help with mobile device resolutions
« Reply #2 on: April 12, 2013, 02:00:41 pm »
Thanks for your reply. Lets consider a different scenario. In my iPad2 project (768x1024) I placed a centered anchored tk2d sprite at 128, 128. In my Android project (720x1280) I would like the sprite to display at 120, 160 which is the original position scaled by the resolution difference factor. What would be the proper way to achieve this with tk2d? I tried your first two suggestions but neither one displays the sprite anywhere near the new position I would like on the device.   

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Help with mobile device resolutions
« Reply #3 on: April 13, 2013, 02:15:11 pm »
About the scenario in your post, what do you want to do about scales? You could ignore scale diff in that scenario, but what about say, if you're scaling to 480x320? a 100x100 image is going to cover a lot more of this resolution than the 1024x768 screen if you don't scale