读书人

cocos2d-x反正屏坐标系转换

发布时间: 2012-07-01 13:15:00 作者: rapoo

cocos2d-x横竖屏坐标系转换
在RootViewController.mm文件中,进行修改

1:默认横屏
// Override to allow orientations other than the default landscape orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return UIInterfaceOrientationIsLandscape( interfaceOrientation );

// switch to this line if you want to set portrait view
// return UIInterfaceOrientationIsPortrait( interfaceOrientation );
}
2:竖屏
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return UIInterfaceOrientationIsPortrait( interfaceOrientation );

// switch to this line if you want to set portrait view
// return UIInterfaceOrientationIsPortrait( interfaceOrientation );
}

读书人网 >操作系统

热点推荐