Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cocos2d+Storyboards, how can I get a working project?

EDIT: Accept / Bounty goes to anyone who can tell me how to make a project that:

  • Uses Cocos2d 2.x
  • Has Storyboards
  • Has ARC
  • Bonus if you provide a download link to a template

The previous question became a mess, and I've pretty much solved it myself. The Bounty is still up for grabs, if anyone wants to make a better version of my project.

HERE IS A WORKING, CLEAN, READY-TO-USE TEMPLATE FOR ANYONE TO USE, COMPLETE WITH ARC, COCOS2D 2.1, STORYBOARDS AND EVERYTHING

Tested in Xcode 4, 5, iOS 6, 7, only on iPhone but should work on iPad aswell.

I looked hard for this when I worked on making this, so I hope I do someone a favour with this. Credit goes to Tiny Tim Games and https://stackoverflow.com/a/11801085/1701411 for the custom files. I've slightly modified these files to work. Usage instructions for noobs is inside the project readme! :)

like image 973
Oscar Apeland Avatar asked Aug 06 '13 14:08

Oscar Apeland


2 Answers

Here is a similar project template. http://www.mediafire.com/download/7dil7uolo5k1syr/Cocos2d+and+Storyboards+and+ARC+template.zip

like image 114
OleB Avatar answered Sep 22 '22 03:09

OleB


You haven't provided any code to support your question but from experience, you could try using self.view.bounds instead of self.view.frame?

Update

Create a property for your CCGLView in your view controller:

@property (nonatomic) CCGLView *glView;

Then create an instance of it as you already have, but saved to your property.

[self setGlView:[[CCGLView alloc] initWithFrame:[[self view] bounds]];

Then implement viewWillLayoutSubviews and update the frame of your CCGLView to match.

- (void)viewWillLayoutSubviews
{
    [super viewWillLayoutSubviews];

    [[self glView] setFrame:[[self view] bounds]];
}
like image 30
Zack Brown Avatar answered Sep 23 '22 03:09

Zack Brown