在主工程文件(xxx.cpp , xxx为你的项目名)中,
函数名为void xxx::SetWindow(CoreWindow^ window)
相关代码片如下:
<pre name="code" class="cpp">void ImpasseForLife::SetWindow(CoreWindow^ window)
{
// Specify the orientation of your application here
// The choices are DisplayOrientations::Portrait or DisplayOrientations::Landscape or DisplayOrientations::LandscapeFlipped
DisplayProperties::AutoRotationPreferences = DisplayOrientations::Portrait;
//...
}
其中修改DisplayOrientations::之后的就行了,默认是Landscape,为横屏,Portrait是竖屏,第三个应该是横屏的另一个方向
cocos2d-x for wp8 设置横竖屏,布布扣,bubuko.com
原文:http://blog.csdn.net/immortal_steller/article/details/37777737