[:ja]【cocos2d】画面の向きを変更する[:en]【cocos2d】change screen orientation of deviece[:]

スポンサードリンク

端末の画面の向きを変更する
RootViewController.mを編集する

Landscape(横向き)
( UIInterfaceOrientationIsLandscape( interfaceOrientation ) );をreturnする
Portrait(縦向き)
( UIInterfaceOrientationIsPortrait( interfaceOrientation ) );をreturnする

[objc]
#elif GAME_AUTOROTATION == kGameAutorotationUIViewController
//
// EAGLView will be rotated by the UIViewController
//
// Sample: Autorotate only in landscpe mode
//
// return YES for the supported orientations

//横向き
//return ( UIInterfaceOrientationIsLandscape( interfaceOrientation ) );
//縦向き
return ( UIInterfaceOrientationIsPortrait( interfaceOrientation ) );

#else
[/objc]

■参照文献

コピペではじめるiPhoneゲームプログラミング

スポンサードリンク
よかったらシェアしてね!
  • URLをコピーしました!
  • URLをコピーしました!

この記事を書いた人

スマホ大好き人間です。

コメント

コメントする

目次