Rendel
Rendel

Reputation: 61

Use only retina images in cocos2d

I am using 2 images: image.png and image-hd.png and it works fine for retina and non-retina too. But what I want to do now is to remove all non-retina images and leave only retina images. I heard that a non-retina device will scale the image down itself. I tried it but it didn't work :( How I do this? What name should I give to the image that it will show picture its actually size on retina and for non-retina will be scaled down?

Upvotes: 0

Views: 397

Answers (2)

CodeSmile
CodeSmile

Reputation: 64477

No, Retina images are not scaled down automatically.

Only using Retina images and using them scaled down on standard resolution display devices is a bad idea.

  • Non-Retina devices have far less memory than Retina devices, but you're forcing them to load the Retina resolution images. In other words: device has half the memory, but is forced to load images that consume four times as much texture memory as need be.
  • Non-Retina devices have slower GPU & CPU. But you're forcing them to work on four times the number of pixels. Performance suffers.

Upvotes: 3

Shefy Gur-ary
Shefy Gur-ary

Reputation: 658

You probably need to scale it down manually. I'm not sure if thats the best idea. But I think you can just scale down the images to 0.5 if in retina device.

About images, its important to remember that each image is taking memory according to the size of the next power 2 dimensions. Which means that 20X20 pic will take the same memory as 32X32, and 130X260 will take 256X512.

So sometimes just handling your image sizes better or using something like Sprite Sheet.

Upvotes: 1

Related Questions