Search VG Five
History
Main | For fun, not profit - Jason Morrissey (Alien Blue dev) »
Thursday
Sep292011

cocos2d 2.0.0 Interface Rotations

I was playing around with the alpha release of cocos2d 2.0.0 and got caught on trying to get the screen to rotate properly to landscape mode. After a bit of searching, I came upon the following line in the release notes:

[NEW] Director: Orientations are no longer supported. Only Portrait mode is supported. Use a ViewController to rotate the EAGL view.

What exactly does this mean? A little more digging found this post and the subsequent response which cleared it up for me.

How to configure your app's supported orientations in cocos2d 2.0.0:

If you're using the cocos2d templates in XCode, you'll want to open up RootViewController.m and look for the following:

Simply uncomment out one of the three lines by folliowing the comments, and your app will automatically only support those orientations. Simple as pie.

Stuck on any part of iOS, cocos2d, or general Objective-C development? Leave a note in the comments and I'll try to address any issues in future posts.

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
All HTML will be escaped. Hyperlinks will be created for URLs automatically.