0

In iOS I'm developing a game(Universal), So at the runtime images are available on server and I'm going to download them. So what I should do?

  1. I can download any image @1x, @2x and @3x. But in this case my every image going to have 2 versions so it will take too much space on server. or
  2. Should I keep @3x image only on server and I resize it to @1x or @2x according to device scale. Which should be preferred.Thanks.
Ashish Thakkar
  • 944
  • 8
  • 27
  • see this once http://stackoverflow.com/questions/30049544/what-should-image-sizes-at-1x-2x-and-3x – Anbu.Karthik Aug 04 '16 at 09:54
  • 1
    You pretty much answered your own question. Where is the point of option #1 if you can go with option #2? – LinusGeffarth Aug 04 '16 at 10:05
  • I don't understand the logic in two versions on your server, when the iOS device has to download the image. If you choose for option 2, you will need to write the code to understand what the resolution of your devices is and then downscale the image to the appropriate level. It is doable, but might proof to be cumbersome. – MacUserT Aug 04 '16 at 10:30
  • Hi @MacUserT, two versions of image means, If we consider the game of car racing so first version is simple car and second version will be car after accident like this. – Jitendra Patil Aug 04 '16 at 10:47
  • Hi Jitendra, thanks for answering my question. The problem of having multiple versions of images, race cars in your case, is always a problem of having multiple images. The same problem arrises when I have a game where the characters degenerate due to injuries or can be upgraded. You can go for option 2 if you have really a storage problem. I would think you should have a global variable that provides you with the details of the screen size and resolution. Every time you load an image, you run check this global variable and downscale the image accordingly. – MacUserT Aug 04 '16 at 12:19

1 Answers1

0

Now apple introduced new concept of app-thinning. You don't have to worry about putting multiple images inside bundle. You add all images 1x, 2x and 3x within the application assets. Based on device type App Store will provide images required to run on the application.