cocos2d-x for wp8 设置横竖屏
在主project文件(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是竖屏,第三个应该是横屏的还有一个方向

浙公网安备 33010602011771号