1

アプリでcocos2d1.0.1を2.0rc1に更新する前に、[[CCDirector sharedDirector] setDeviceOrientation:(ccDeviceOrientation)currentOrientation];を呼び出していました。方向の1つの変化が検出されたときに一部のシーンに挿入し、currentOrientationに応じて他のシーンをポートレートまたはランドスケープでロードします。

でも今はどうしたらいいのかわからない。

4

2 に答える 2

2

Orientation setOrientation ( Orientation orientation )
デバイスの向きを変更するためのCCDirectorによるコールバック。

CCDirectorが変更したい方向の定義。

戻り値アプリケーションの実際の向き。

于 2012-10-21T17:41:57.550 に答える
1

AppDelegate.mを開き、次のメソッドを見つけます。

// Supported orientations: Landscape. Customize it for your own needs
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}

アプリがサポートするすべての方向に対してYESを返します。

于 2012-05-21T21:22:44.700 に答える