Search Unity

Screen Orientation

Discussion in 'Windows' started by gv, Nov 8, 2013.

  1. gv

    gv

    Joined:
    Feb 22, 2013
    Posts:
    89
    I didnt realize how difficult it would be to convert a Windows Phone app to Windows Store... ;)

    How do I load my game in portrait mode on Windows Store ?? But only for tablets...

    Also how should I handle the fact that Windows Store apps can be run on a laptop or PC which of course is in landscape.. Can you put black bars on either side or how have any of you handled this ?
     
  2. tswalk

    tswalk

    Joined:
    Jul 27, 2013
    Posts:
    1,109
    It will most always load in landscape mode, but you can specify in the project manifest to 'prefer' landscape. just double click on the "package.appxmanifest" file in visual studio, and check the supported rotation you want.

    then, in your view state management code, you would setup two grid layouts.. one for portrait that utilizes the full verticle screen space... and another for "landscape" mode that you could layout a grid with the "black bars" on teh sides, and your verticle space in the center. However, the problem you will run into is that the SwapChainBackgroundPanel will fill the entire screen either way and I do not believe their is a way to control this. e.g: How will you handle the display aspect ratio change... not sure, but could be an issue.