Universal cocos2d game to support iPad3

2019-04-10 04:05发布

How would the image resources be named for the ipad & ipad HD versions in a universal app?

When supporting normal and HD images for iphone we use imageName.png & imageName-hd.png. But if I make an universal am I right in assuming that I would have to rename the images and use imageNameiPad.png & imageNameiPad-hd.png?

Please let me know how the naming convention works.

Thanks Abhinav

3条回答
Evening l夕情丶
2楼-- · 2019-04-10 04:19

The correct way in cocos2d (version 2.0 or 1.1beta) is this:

Normal iPhone:

image.png

Retina iPhone:

image-hd.png

Normal iPad:

image-ipad.png

Retina iPad:

image-ipadhd.png

You must just call image.png in your code, then the code will detect what device is and use the file properly.

查看更多
Rolldiameter
3楼-- · 2019-04-10 04:24

I guess that'll work exactly as you would name ressource to support retina display on iOS (for iPhone). Which to my mind is :

  • MyFile.png is the standard resolution
  • Myfile@2x.png is the resolution for retina display
查看更多
劫难
4楼-- · 2019-04-10 04:29

I beleive that it goes something like this:

Normal iPhone:

image.png

Retina iPhone:

image.png-hd

Normal iPad:

image.png-ipad

Retina iPad:

image.png-hd-ipad

Do not use @2x instead of -hd because you will find that you will get some errors.

查看更多
登录 后发表回答