Я хочу изменить первый вид в портретном режиме, а второй вид - в альбомном, я использую файл gameconfig.h
.
Код:
//
// GameConfig.h
// Cocos2DSimpleGame
//
// Created by Ray Wenderlich on 11/21/10.
// Copyright Ray Wenderlich 2010. All rights reserved.
//
#ifndef __GAME_CONFIG_H
#define __GAME_CONFIG_H
//
// Supported Autorotations:
// None,
// UIViewController,
// CCDirector
//
#define kGameAutorotationNone 0
#define kGameAutorotationCCDirector 1
#define kGameAutorotationUIViewController 2 //2
//
// Define here the type of autorotation that you want for your game
//
#define GAME_AUTOROTATION kGameAutorotationUIViewController
#endif // __GAME_CONFIG_H
and in my appDelegate file is:
#if GAME_AUTOROTATION == kGameAutorotationUIViewController
[director setDeviceOrientation:kCCDeviceOrientationPortrait];
#else
[director setDeviceOrientation:kCCDeviceOrientationLandscapeLeft];
//[director setDeviceOrientation:kCCDeviceOrientationLandscapeLeft];
// [director setDeviceOrientation:kCCDeviceOrientationLandscapeLeft];
#endif
В первом окне я хочу показать меню в портретном режиме, а также, когда я нажимаю на новую игру, игра отобразится в ландшафтном режиме. Я также использую shouldAutoInterfaceOrientation
, но я не нашел решения.