65.9K
CodeProject is changing. Read more.
Home

Windows Phone 7.5 XNA Game Orientation in Mixed Mode

starIconstarIconstarIconstarIconstarIcon

5.00/5 (1 vote)

Oct 18, 2011

CPOL
viewsIcon

27755

How to set orientation to landscape mode for XNA game in mixed mode (Silverlight & XNA)

Introduction

Maybe this will save someone some time.
 
When you create a Windows Phone Silverlight and XNA project, the XNA part will be set to Portrait mode.
To change it to Landscape, you need to:

  • Set orientation of XNA page to landscape
  • Replace in App.xaml:
    <xna:SharedGraphicsDeviceManager/>

    with:

    <xna:SharedGraphicsDeviceManager PreferredBackBufferWidth="800" 
    PreferredBackBufferHeight="480"  />

    if all of your XNA pages will be in this resolution. If not, you can set in code for each XNA page.