Skip to content

Instantly share code, notes, and snippets.

@phi-jp
Created July 5, 2013 07:18
Show Gist options
  • Save phi-jp/5932603 to your computer and use it in GitHub Desktop.
Save phi-jp/5932603 to your computer and use it in GitHub Desktop.

縦向きにする

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 UIInterfaceOrientationMaskLandscape;
	return UIInterfaceOrientationMaskPortrait;
#endif
}

シーンきりかえ

CCScene *pScene = HelpLayer::scene();
 
// 0.5秒かけてフェードアウトしながら次の画面に遷移します
CCTransitionFade* transition = CCTransitionFade::create(0.5f, pScene);
 
CCDirector::sharedDirector()->replaceScene(transition);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment