

Cocos2d Conversion Tips for the iPhone 5 - brianchu
http://blog.makegameswith.us/post/35021622266/cocos2d-conversion-tips-for-the-iphone-5

======
zbowling
I disagree with a few tips here. Rather than code to exact resolutions (eg:
`if ([CCDirector sharedDirector].winSize.width == 568)`) build your games to
be adaptive to the screen. That way when a new device is released you don't
end up going through and making your code swiss cheese.

A better idea is to maybe make decisions when a size is greater than a certain
amount, but still layout to relative amounts to the screen. This will make it
easier to support landscape and portrait on 4/3 devices as well and not just
3/2 and 16/9 screens. Perhaps add additional HUD when you have the space.

Better yet, setup your simulator for several different sizes, and every now
and then make sure everything still fits:
[http://0xced.blogspot.com/2012/08/prepare-your-apps-for-
new-...](http://0xced.blogspot.com/2012/08/prepare-your-apps-for-new-
iphone.html)

Later come talk to us at Apportable (YC2011 <http://apportable.com/> ) and you
can use our SDK to have your Cocos2D game run natively on hundreds of
different resolutions and DPIs on Android.

~~~
Jare
To be fair, the author does suggest adaptive strategies all over the article.
In practice, it's not uncommon to mix adaptive for the general case together
with special cases optimized for a few specific, common and popular
resolutions.

~~~
zbowling
sure, I don't mind mixing, but I don't vote for checking for exact
resolutions, but rather ranges of resolution ratios. Instead of checking for
"width == 586" check for width/height and checking to seeing if it's close to
16/9 or 3/2 or 4/3 and then using specific UI for those cases, but still keep
the layout relative.

