Universal cocos2d game for iPad3 support

What will the image resources for the ipad and ipad HD versions be called in the universal application?

With support for regular and HD images for iphone, we use imageName.png and imageName-hd.png . But if I make it universal, am I right in believing that I will have to rename images and use imageNameiPad.png and imageNameiPad-hd.png ?

Please let me know how the naming convention works.

Thanks Abhinav

+4
source share
3 answers

The correct way to cocos2d (version 2.0 or 1.1beta) is as follows:

Regular iPhone:

image.png

Retina iPhone:

image-hd.png

Regular iPad:

image-ipad.png

Retina iPad:

image-ipadhd.png

You just need to call image.png in your code, then the code will determine what the device is and use the file correctly.

+15
source

I believe this happens something like this:

Regular iPhone:

image.png

Retina iPhone:

image.png-HD

Regular iPad:

image.png-ipad

Retina iPad:

image.png-HD-iPad

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

+4
source

I assume that this will work exactly as you would call ressource to support retina display on iOS (for iPhone). In my opinion:

  • MyFile.png - standard resolution
  • Myfile@2x.png - permission to display the retina.
-1
source

Source: https://habr.com/ru/post/1400443/


All Articles