소프트웨어/cocos studio

[cocos studio] 세로 화면에서 개발하기

개발자_이훈규 2016. 2. 12. 21:05

회전에 대한 자세한 설명 : http://hiddenviewer.tistory.com/207

회전에 대한 기기별 조작법 : http://m.blog.naver.com/mssixx/150172468535



이 부분을 반드시 처리해야한다.

이 '프로젝트 명'을 선택하면 아래의 화면이 나오는데 Device Orientation의 부분만 체크를 해야한다.






Reference : http://zzaps.tistory.com/131


cocos2d-x 로 프로젝트를 생성하면, 기본적으로 가로 화면으로 설정되어져 있다.


난 세로 화면에서 돌아가는 게임을 만들고 싶은데, 어떻게 하면 좋은가?


RootViewController.mm 에서 아래 내용으로 수정하면 된다.

// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead

- (NSUInteger) supportedInterfaceOrientations{

#ifdef __IPHONE_6_0

//    return UIInterfaceOrientationMaskLandscape; // 가로 화면 

    return UIInterfaceOrientationMaskPortrait; // 세로 화면

#endif

}


참고로 저기에 설정할 수 있는 값들은 아래와 같다. iOS 6.0 이상에서 가능하다.


Constants

UIInterfaceOrientationMaskPortrait

The view controller supports a portrait interface orientation.


UIInterfaceOrientationMaskLandscapeLeft

The view controller supports a landscape-left interface orientation.


UIInterfaceOrientationMaskLandscapeRight

The view controller supports a landscape-right interface orientation.


UIInterfaceOrientationMaskPortraitUpsideDown

The view controller supports an upside-down portrait interface orientation.


UIInterfaceOrientationMaskLandscape

The view controller supports both landscape-left and landscape-right interface orientation.


UIInterfaceOrientationMaskAll

The view controller supports all interface orientations.


UIInterfaceOrientationMaskAllButUpsideDown

The view controller supports all but the upside-down portrait interface orientation.