Permalink
Browse files

- fixed rotation

- adapting to ios6
- added ipad to supported ios platforms
- z-ordering in example screen
  • Loading branch information...
1 parent 561072b commit b287ec1775a596f14456238557e1b95b598e078d @refaelos refaelos committed Mar 21, 2013
@@ -747,6 +747,7 @@
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = "";
PRODUCT_NAME = "$(TARGET_NAME)";
+ TARGETED_DEVICE_FAMILY = "1,2";
VALID_ARCHS = "armv6 armv7 i386";
WRAPPER_EXTENSION = app;
};
@@ -774,6 +775,7 @@
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = "";
PRODUCT_NAME = "$(TARGET_NAME)";
+ TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VALID_ARCHS = "armv6 armv7 i386";
WRAPPER_EXTENSION = app;
@@ -54,7 +54,7 @@ bool AppDelegate::applicationDidFinishLaunching() {
CCFileUtils::sharedFileUtils()->setResourceDirectory("iphonehd");
// don't enable retina because we don't have ipad hd resource
- CCEGLView::sharedOpenGLView()->setDesignResolutionSize(960, 640, kResolutionNoBorder);
+ CCEGLView::sharedOpenGLView()->setDesignResolutionSize(720, 1280, kResolutionNoBorder);
}
else if (target == kTargetIphone)
{
@@ -124,6 +124,9 @@ bool MainScene::init()
CCSize visibleSize = CCDirector::sharedDirector()->getVisibleSize();
CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin();
+ CCLabelTTF* pLabelGame = CCLabelTTF::create("[YOUR GAME HERE]", "GoodDog.otf", 54);
+ pLabelGame->setPosition(ccp(visibleSize.width/2 + origin.x, visibleSize.height/2 - 0 + origin.y));
+ this->addChild(pLabelGame, 1);
CCSprite* bgSprite = CCSprite::create("img_direct.jpg");
bgSprite->setPosition(ccp(visibleSize.width/2 + origin.x, visibleSize.height/2 + origin.y));
@@ -133,19 +136,15 @@ bool MainScene::init()
pLabelTitle->setPosition(ccp(visibleSize.width/2 + origin.x, visibleSize.height - 100 + origin.y));
this->addChild(pLabelTitle, 1);
- CCLabelTTF* pLabelGame = CCLabelTTF::create("[YOUR GAME HERE]", "GoodDog.otf", 54);
- pLabelGame->setPosition(ccp(visibleSize.width/2 + origin.x, visibleSize.height/2 - 0 + origin.y));
- this->addChild(pLabelGame, 1);
-
pRightBox = CCSprite::create("right_bg.png");
pRightBox->setScale(2.0f);
pRightBox->setPosition(ccp(origin.x + visibleSize.width - (pRightBox->boundingBox().size.width / 2) - 50, 250 + origin.y));
- this->addChild(pRightBox, 0);
+ this->addChild(pRightBox, 2);
Soomla* pSoomla = Soomla::create("soomla_logo_new.png", pRightBox);
pSoomla->setScale(2.0f);
pSoomla->setPosition(ccp(origin.x + (pSoomla->boundingBox().size.width / 2) + 50, 250 + origin.y));
- this->addChild(pSoomla, 0);
+ this->addChild(pSoomla, 2);
CCLabelTTF* pLabelInstructions = CCLabelTTF::create("Drag the SooMLA-bot to the box top open store", "GoodDog.otf", 24);
@@ -41,11 +41,20 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil];
viewController.wantsFullScreenLayout = YES;
viewController.view = __glView;
-
+
// Set RootViewController to window
- [window addSubview: viewController.view];
+ NSString *reqSysVer = @"6.0";
+ NSString *currSysVer = [[UIDevice currentDevice] systemVersion];
+
+ if ([currSysVer compare:reqSysVer options:NSNumericSearch] != NSOrderedAscending)
+ {
+ [window setRootViewController:viewController]; //iOS 6
+ } else
+ {
+ [window addSubview: viewController.view]; //iOS 5 or less
+ }
[window makeKeyAndVisible];
-
+ __glView.multipleTouchEnabled = YES;
[[UIApplication sharedApplication] setStatusBarHidden: YES];
cocos2d::CCApplication::sharedApplication()->run();
@@ -27,6 +27,21 @@ - (void)viewDidLoad {
}
*/
+
+- (BOOL)shouldAutorotate
+{
+ //returns true if want to allow orientation change
+ return YES;
+}
+
+- (NSUInteger)supportedInterfaceOrientations
+{
+ return UIInterfaceOrientationMaskLandscape;
+
+ // switch to this line if you want to set portrait view
+ // return UIInterfaceOrientationMaskPortrait;
+}
+
// Override to allow orientations other than the default landscape orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return UIInterfaceOrientationIsLandscape( interfaceOrientation );

0 comments on commit b287ec1

Please sign in to comment.