I have a script that I wrote that takes a folder of images, and automatically resizes them to the @3x, @2x, and @1x equivalents.
I named the folders @3x, @2x, @1x, and inside each folder every image has a suffix of @3x.png, @2x.png, @1x.png, respectively. (So for example bouncing-ball-frame-1@3x.png resides in the @3x folder)
The way I used to import images was just this:
- Manually create a new sprite atlas folder in XCAssets using the "+" button in Xcode
- Manually drag and drop the @3x images into this folder. Xcode will then use these images as their @3x versions.
- Manually (1 by 1) move each @2x image, and each @1x image, into their respective "slots" next to the @3x image.
But now that I have tons of images i'll be using, this is just a lot of work for me.
I was hoping I could just drag and drop an entire folder into XCAssets (with all of the 3x,2x,1x images), and Xcode would automatically put each image where it belongs in one giant sprite atlas.
Is this sort of thing possible? I could've sworn I read somewhere that if you name the folders/images a certain naming convention, and suffix the parent as .atlas, then it does this all for you without having to manually do it.
Could anyone offer advice/solution for this?
Thanks!