I am very fresh to iOS app development and currently working on Sprite Kit.
I am observing some strange behavior when images are added into images.xcassets
. I am creating a folder inside xcassets as shown in figure for better organisation of images.
Then while adding this images from inside the folder of xcassets into sks file I am getting few problems.
A) If I drag the images from column as shown in figure
and when I place the image in sks file, I do not get the name of texture as shown in image.
But however, if the image was added in xcassets without creating the folder, the texture name appears. How to overcome this problem if image is present inside a folder in xcassets?
B) Similar is the problem, if I drag “Color Sprite” into sks file, and if I wish to add an image present inside the folder of xcassets, it doesn’t read it. But the image present directly inside xcassets is able to be read. How to overcome this problem if image is present inside a folder in xcassets?
C) Next problem is if I copy the entire project folder into different place (or even if I close the project and open it again), and then if I open up the sks file, I get the following problem.
The image added inside xcassets appears directly, but image added inside the xcassets folder, fails to appear in sks file and even when I run the code. However, if I check in images.xcassets folder, the image exists inside.
None of the above problem happens if I make use of XIB.
I have read about atlases in sprite kit, but I would not like to make use of it as my images remain constant throughout the execution.