Hello Guest

Author Topic: Mobile device resolutions  (Read 3879 times)

Ben

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 9
    • View Profile
Mobile device resolutions
« on: May 11, 2013, 11:28:15 am »
Hi,

How 2D Toolkit solves the problem of different resolutions on mobile devices? tk2dCamera has two different settings for resolution, that is, native resolution and camera resolution. Say, I set both of them to 800x1280, which is the resolution of Nexus 7, and now if I run my game on an Android device with a smaller resolution eg. 540x960 the game doesn't scale down to fit the screen and large part of the stage is outside the screen.
Other mobile game frameworks, for instance AndEngine, have dedicated functions that scale proportionally the stage up and down depending on the device resolution. So if the game is built for 800x1280 it'll fit proportionally to 540x960 or 480x800. How that problem is solved in 2D Toolkit?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Mobile device resolutions
« Reply #1 on: May 11, 2013, 02:51:34 pm »
What you want is a tk2dCamera override. Adding the default override will (click "Add override" and just use the default settings), will automatically scale your 800x1280 game to whatever resolution its rendering in. It scales to Fit Visible by default. This means that the largest axis will be scaled to fit. Its your responsibility to add letter boxing bars, etc. if the aspect ratios don't match.



Ben

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Mobile device resolutions
« Reply #2 on: May 11, 2013, 05:57:38 pm »
It works perfectly! Thank you very much!