Click here to Skip to main content
15,860,859 members
Articles / Programming Languages / C#
Tip/Trick

Windows Phone 7.5 XNA Game Orientation in Mixed Mode

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
10 Jan 2013CPOL 27.4K   3   1
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:
    XML
    <xna:SharedGraphicsDeviceManager/>

    with:

    XML
    <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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer ABB
Poland Poland
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionReverse ? Pin
AmitDey14-Oct-12 3:19
AmitDey14-Oct-12 3:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.