GPProd wrote:I want to import the files 1 by 1, not all at once. This way they keep overwriting each others, the first sprite takes the same image as sprite 2, etc. Any idea how i can import 1 file at a time and keep the image?
There are not really any good solution for this i think as its designed this way in C2. The issue have been raised before by other as well. but don't think it will be changed as it doesn't appear to be a problem by Scirra.
From what I understand and explained simple, it is made this way to reduce download size at the cost of memory in case you actually need to load images during runtime.
The only way as far as I have figured out to bypass it or workaround it, is to add empty frames to the sprite that need to store the loaded images. And then load each image into its own frame for each sprite.
So if you want to load 3 images. You sprite need to have 3 frames. then you need to make a counter to make sure that each image is loaded to the correct frame.
If you need to replace any of these images later on, you have further increase the number of empty frames. Which is where the memory cost starts to add up, because if you for instant want to be able to load 50 images, not meaning 50 images at the same time only, but just load images with the file chooser for a total of 50 times. You have to add 50 empty frames which will be stored in memory even if they are not needed.
So to make a workaround you need to do the following two things:
1. You need to know how many images you want to load or allow to be loaded and based on that you have to created empty frames to your sprite that can handle it.
2. Make a counter that keep track of which frame to load the image too.
You need to be aware that if you exceed the maximum number of frames and start from frame 0 again then the problem will reappear, so its a trade off between usability and memory use as I see it.
So the workaround ain't pretty and not effective in anyway, but as far I know the only working one.