2012-05-06 1 views

답변

3

사용중인 cocos2d 버전을 말하지 않았지만 GameConfig.h 파일이 없으므로 2.0rc를 사용하고있는 것으로 추측합니다. 그런 경우

, AppDelegate.m에보고 당신은 발견 할 것이다 :

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    return UIInterfaceOrientationIsLandscape(interfaceOrientation); 
} 

변경 가로 세로로 지금 그래서 :

return UIInterfaceOrientationIsPortrait(interfaceOrientation); 

귀하의 게임 만 사이에 자동 회전합니다 두 세로 방향입니다.

적인 Cocos2D 아이폰 v3에서
+0

이 작업을 수행했습니다. 장면에는 아무 것도 발생하지 않습니다. –

3

, 당신은 같은 초기 설정 호출을 통해 방향을 설정할 수 있습니다적인 Cocos2D에서

-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{ 
    [self setupCocos2dWithOptions:@{ 
            CCSetupTabletScale2X: @(YES), 
            CCSetupScreenOrientation: CCScreenOrientationPortrait 
            }]; 
    return YES; 
} 
+0

프로젝트 설정> 일반> 배치 정보> '장치 방향'> '세로'및 '거꾸로' – chunkyguy

0

당신이 평소처럼 didFinishLaunchingWithOptions 방법에 AppDelegate에 설정해야 V3 :

[self setupCocos2dWithOptions:@{ 
           CCSetupShowDebugStats: @(YES), 
           CCSetupScreenOrientation: CCScreenOrientationPortrait, 
    }]; 

"스와

및"인터페이스 방향 지원 "음성에서 프로젝트의의 Info.plist에서 (I 생략 한 더 많은 옵션을 사용할 수 있습니다) 또는 pPorted 인터페이스 방향 (iPad) "가로 대신 세로 설정 (iPads의 경우 기본값).

관련 문제