Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cocos2d iphone 5 4 inch display support

I have been looking everywhere for this but with no luck.

How do I prepare my cocos2d based game for bigger 4 inch display of the iPhone 5? My app is working but i want to enhance it for the bigger 4 inch display. Cocos2d uses its own suffixes for retina display images. For retina display of the iPhone 4 and 4S it is image-hd.png. Is there a suffix for iPhone 5? How do I accomplish this?

Cheers.

like image 470
Majster Avatar asked Sep 19 '12 19:09

Majster


1 Answers

There is no extra file suffix for iPhone 5, after all it's only 176 pixels (88 points) wider. It's treated like a regular Retina phone, hence cocos2d will load the -hd files.

The rest is just about positioning your images depending on the device. The simplest way is to just treat the 44 points on either side as a "dead zone" where no user input can occur and where there's no guarantee the user can see game objects.

Update: cocos2d 2.1 added the -widehd suffix. It was said that 2.1 final release will have the suffix renamed to -iphone5hd.

In light of future screen sizes I sould personally set and use a -568hd suffix because other phones beside iPhone 5 may have the same resolution. Naming the suffix after a specific iPhone model is a tad short-sighted to say the least.

like image 92
LearnCocos2D Avatar answered Sep 30 '22 16:09

LearnCocos2D