Windows Phone - how to set orientation

Monkey Targets Forums/XNA/Windows Phone - how to set orientation

Lugato(Posted 2012) [#1]
Hi to all,

Im new in the WP7 ..

Im testing all my apps and library in a Lumia 800 and 90% are working well ;) thanks for monkey :)

I have some troubles with touch, sound and orientation .. I have some ideas to solve Sound and Touch problems .. but any idea in the orientation :(

In the emulator I can change the orientation display, but my app continue in the portrait mode .. anyone have some idea where I can set orientation mode in XNA ?

thanks


Volker(Posted 2012) [#2]
It should be enough to set the resolution in your .build/config.txt.
XNA_WINDOW_WIDTH_PHONE=800
XNA_WINDOW_HEIGHT_PHONE=480
WP detects automatically if it's portrait or landscape.


smilertoo(Posted 2012) [#3]
not sure if that works but it doesn't appear to using ignition engine. There should be a way of defining which orientations are allowed.


dave.h(Posted 2012) [#4]
once youve started visual studio express 2010 and opened the windows phones copy of monkeygame you can then edit the program.cs .Near the top of the file edit it like volker says and it will set it automatically.


smilertoo(Posted 2012) [#5]
will it remember this or will you need to redo it every time you make a change to your monkey program?


dave.h(Posted 2012) [#6]
it will stay that that way


Rone(Posted 2012) [#7]
To adjust the orientation manually, PresentationParameters.DisplayOrientation needs to be changed manually.
Look at gxtkGame.PreparingDeviceSettings in Program.cs

For example:

pp.DisplayOrientation = DisplayOrientation.Portrait;

http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.graphics.presentationparameters.displayorientation.aspx


smilertoo(Posted 2012) [#8]
does monkey have a way of embedding native code so monkey ignores it and copies it directly into the output project?