Hello Guest

Author Topic: Scaling issue while changing Aspect Ration in preview player.  (Read 4410 times)

jjv

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 8
    • View Profile
Scaling issue while changing Aspect Ration in preview player.
« on: August 07, 2014, 04:20:06 am »
Hi there,

Context:
I'm new to both Unity and 2D Toolkit and I'm having hard time grasping how to properly configure multi-resolution support.  I spend few days reading through 2D toolkit docs, online articles, forum and watching some random you-tube videos, it is all hard to digest, but I came to conclusion that it depends on what kind of game you are building and what kind of devices / resolutions your are planning to support.
I wish there was some wiki page with a grid that outlines different scenarios with "best practices" values for the configuration. For example in my case: I wan't to target as many devices as possible. My game will have a fixed screen (no scrolling). Will use 2d physics. Proportions between game elements should stay the same (except HUD elements). Probably will use pixel art. Based on my research so far seems like the default configuration seems to be sensible enough!:
  • Native resolution 960x640 (I guess it the middle ground between low res and hi res)
  • Pixel per Unit 100 (sort of required when we use physics 2d)
  • Fit visible (to accommodate most of the devices)

Issue:
When I go with those defaults, create sprite collection (same settings) and add a sprite everything looks good in native resolution. However when I switch preview to not matching aspect ration thing stretch (see pic). Does this mean that framework doesn't handle this out of box with some sort of default solution? I tried to create override for that aspect ratio but whatever value I choose for Auto Scale it doesn't seem to do anything. How should one go about handling that? Should I programmatically add some black bars on the sides?

Thanks 


« Last Edit: August 07, 2014, 04:28:43 am by jjv »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Scaling issue while changing Aspect Ration in preview player.
« Reply #1 on: August 07, 2014, 10:42:39 am »
Hi,

The aspect ratio drop down in Unity isn't automatically detected. Enter a correct resolution there, or in the general tab, pick a right resolution - there should be a warning there saying that tk2d can't work out what resolution you're running at. On device, fit visible will just work.

jjv

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Scaling issue while changing Aspect Ration in preview player.
« Reply #2 on: August 07, 2014, 02:15:49 pm »
Oh, I saw the warning (red stop sign drew my attention) but the message didn't made me think that it is just Unity player issue and things will just work fine on the actual device. Thanks!