问题
I've been searching around for a while, but it's been hard to find a definit list of available suffixes which you can use for multi resolution support, if there is any? That is, loading images in a dimension depending on what device you're on. Especially for the interface.
I know that the "-hd" suffix exists for ipad retina display support, but besides that it would also be nice if there is any suffix for regular iPad resolution as well as an iPhone suffix when the game is loaded on an iPhone.
I've tried using suffixes like "-ipad" and "-iphone", but they do not seem to be recognized.
Anyone have tips on how this can be achieved, if at all?
回答1:
You need to be using cocos2d v1.1 or v2.0. Then you can use these extensions on assets supported by cocos2d (images, tilemaps, bitmap fonts, particle effects):
- -hd (iPhone/iPod Retina)
- -ipad (iPad 1 & 2)
- -ipadhd (iPad Retina)
The CCFileUtils class has methods that allow you to use different suffixes and enable/disable automatic fallback to the next lower resolution assets.
Earlier cocos2d versions support only -hd, with the -ipad suffix not supported in most versions because it was for a long time only available in a separate github branch. The -ipadhd suffix is fairly new, introduced in cocos2d v1.1 and v2.0.
At this time there is no special suffix for Mac Retina displays.
来源:https://stackoverflow.com/questions/12053485/what-exactly-is-the-available-file-suffixes-for-cocos2d-used-for-multi-resoluti