EDIT: Accept / Bounty goes to anyone who can tell me how to make a project that:
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! :)
Here is a similar project template. http://www.mediafire.com/download/7dil7uolo5k1syr/Cocos2d+and+Storyboards+and+ARC+template.zip
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]];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With