Hello Guest

Author Topic: Windows Store Universal App Resolution bug?  (Read 4329 times)

ElementCy

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 2
    • View Profile
Windows Store Universal App Resolution bug?
« on: August 19, 2014, 07:11:09 pm »
I am using the Windows Store Universal App build in Unity, setting resolution to 1280x720 & deploying it to my Lumia 1020 phone.

In portrait mode, I have a sprite that moves on the screen on the Y axis. When I tilt my phone to go to landscape mode, I swap the sprites current Y to it's X, and replace the Y to 0. In theory, the sprite should be in the exact same spot on the screen. It seems that when going to landscape, the projection is different. In Portrait, I put the sprite at the very top of the screen, when I switch to landscape, the sprite is off the screen. Same goes when I put the sprite at the very bottom of the screen.

Any ideas on how to fix this?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Windows Store Universal App Resolution bug?
« Reply #1 on: August 19, 2014, 11:37:30 pm »
tk2d uses whatever Unity says the resolution is. I dont know if its behaving differently in Windows Store mode, find out what Screen.width and height is returning in both those cases, and it'll probalby explain what its doing. Also, check where 0,0 and 100, 100 is in your config.

ElementCy

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Windows Store Universal App Resolution bug?
« Reply #2 on: August 20, 2014, 03:18:58 am »
Screen Width and Height swapped exactly same values when changing from Portrait to Landscape.

I did get it to work by overriding the tk2dCamera's Auto Scale from Fit Visible to Pixel Perfect. Not sure why that would make a difference, since the screen res was exactly as it should be from switching to/from Portrait/Landscape.

Thanks.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Windows Store Universal App Resolution bug?
« Reply #3 on: August 20, 2014, 12:20:02 pm »
Well when you set fit visible, you're telling it what the native resolution is to start with. Thats specified on the tk2dCamera. When you switch orientation, you're not changing that, so the tk2dCamera is trying to rescale a 1024x768 object to fit a 768x1024 screen. You will need to change it for it to work properly.