mobile/cocos2d-x

[cocos2d-x] orientation 변경

manywaypark 2012. 11. 30. 15:21

기본적으로 cocos2dx 프로젝트를 생성하면 orientation이 landscape인데, portrait로 변경해야하는 경우도 있다.


iOS의 경우:

app_name/ios/RootViewController.mm 에서 shouldAutorotateToInterfaceOrientationsupportedInterfaceOrientationsshouldAutorotate 등을 변경하면 된다.

6.0의 경우는 약간의 이슈가 있는듯...


Android의 경우:

AndroidManifest.xml 파일에서 main activity에 android:screenOrientation 속성을 변경한다.


refs:

http://www.cocos2d-x.org/news/73

http://www.cocos2d-x.org/projects/cocos2d-x/wiki/About_device_orientation


happy hackin'

ps. 상기 방법말고 OpenGL 쪽에서 설정하는 방법도 있다 (두번째 참조링크 참조).