cocos2d-x의 화면 방향 (종횡)은 설정만으로는 끝나지 않으므로 정리해 둡니다.
2958 단어 Xcodecocos2d-xObjective-C
소개
cocos2d-x로 프로젝트를 만든 직후에 먼저 할 화면의 종횡 설정을 정리합니다.
설정을 괴롭히는 것만으로는 안되기 때문에, 토탈로 무엇을 하는지를 정리해 둡니다.
※「이것도 필요하잖아!」등의 붙어 있으면 코멘트해 주세요.
화면의 가로세로 설정
iOS
프로젝트의 [General]
를 열고 [Device Orientation]
를 설정합니다.
Portrait : 세로
Landscape : 옆 (좌우는 어느 쪽이라도 괜찮습니다)
그런 다음 이전 버전 지원 (iOS7 이전)을 위해 다음 코드를 추가하는 것이 좋습니다.
RootViewController.mm// Override to allow orientations other than the default portrait orientation.
// This method is deprecated on ios6
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
//return UIInterfaceOrientationIsLandscape( interfaceOrientation ); //横
return UIInterfaceOrientationIsPortrait( interfaceOrientation ); //縦
}
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
-(NSUInteger) supportedInterfaceOrientations{
#ifdef __IPHONE_6_0
//return UIInterfaceOrientationMaskAllButUpsideDown; //横
return UIInterfaceOrientationMaskPortrait; //縦
#endif
}
안드로이드
프로젝트에서 [AndroidManifest.xml]
의 [android:screenOrientation]
를 설정합니다.
portrait : 세로
landscape : 옆
AndroidManifest.xml<activity android:name="org.cocos2dx.cpp.AppActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" //★この部分★
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="orientation">
참고 : 화면 방향 설정
스플래시 화면
iOS
iOS에서는 [Launch Image Source]
를 [Images.xcassets]
를 이용하도록 전환한 후 다음 설정을 합시다.
세로의 경우
옆의 경우
안드로이드
Android에서는 스플래시를 만들지 않는 것이 좋습니다.
아무래도 하는 분은 이 기사를 참고로 되어는 어떨까라고 생각합니다.
참고 : Android에서 스플래시 화면을 만드는 방법
후기
프로젝트 신규 작성시에는, 해상도 대응등 여러가지 일이 많이 있습니다.
어느 쪽은, 정리하려고 생각하고 있습니다만, 이번은 화면의 방향 설정에 대해였습니다.
참고 : cocos2dx 화면 해상도 대응
Reference
이 문제에 관하여(cocos2d-x의 화면 방향 (종횡)은 설정만으로는 끝나지 않으므로 정리해 둡니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/tadamatu/items/98a9539ab3dd951489f5
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
iOS
프로젝트의
[General]
를 열고 [Device Orientation]
를 설정합니다.Portrait : 세로
Landscape : 옆 (좌우는 어느 쪽이라도 괜찮습니다)
그런 다음 이전 버전 지원 (iOS7 이전)을 위해 다음 코드를 추가하는 것이 좋습니다.
RootViewController.mm
// Override to allow orientations other than the default portrait orientation.
// This method is deprecated on ios6
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
//return UIInterfaceOrientationIsLandscape( interfaceOrientation ); //横
return UIInterfaceOrientationIsPortrait( interfaceOrientation ); //縦
}
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
-(NSUInteger) supportedInterfaceOrientations{
#ifdef __IPHONE_6_0
//return UIInterfaceOrientationMaskAllButUpsideDown; //横
return UIInterfaceOrientationMaskPortrait; //縦
#endif
}
안드로이드
프로젝트에서
[AndroidManifest.xml]
의 [android:screenOrientation]
를 설정합니다.portrait : 세로
landscape : 옆
AndroidManifest.xml
<activity android:name="org.cocos2dx.cpp.AppActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" //★この部分★
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="orientation">
참고 : 화면 방향 설정
스플래시 화면
iOS
iOS에서는 [Launch Image Source]
를 [Images.xcassets]
를 이용하도록 전환한 후 다음 설정을 합시다.
세로의 경우
옆의 경우
안드로이드
Android에서는 스플래시를 만들지 않는 것이 좋습니다.
아무래도 하는 분은 이 기사를 참고로 되어는 어떨까라고 생각합니다.
참고 : Android에서 스플래시 화면을 만드는 방법
후기
프로젝트 신규 작성시에는, 해상도 대응등 여러가지 일이 많이 있습니다.
어느 쪽은, 정리하려고 생각하고 있습니다만, 이번은 화면의 방향 설정에 대해였습니다.
참고 : cocos2dx 화면 해상도 대응
Reference
이 문제에 관하여(cocos2d-x의 화면 방향 (종횡)은 설정만으로는 끝나지 않으므로 정리해 둡니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/tadamatu/items/98a9539ab3dd951489f5
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
프로젝트 신규 작성시에는, 해상도 대응등 여러가지 일이 많이 있습니다.
어느 쪽은, 정리하려고 생각하고 있습니다만, 이번은 화면의 방향 설정에 대해였습니다.
참고 : cocos2dx 화면 해상도 대응
Reference
이 문제에 관하여(cocos2d-x의 화면 방향 (종횡)은 설정만으로는 끝나지 않으므로 정리해 둡니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/tadamatu/items/98a9539ab3dd951489f5텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)