I'm afraid I have a problem with a "NullPointerException".
I'm writing a Processing (v4) Sketch, which should load multiple svg files from a folder, into a PShape Array. Initializing the array works fine, giving it a length works fine but somehow when I want to overwrite a value, I get a NullPointerException.
int imageCount = 1;
PShape[] images;
void setup() {
images = new PShape[imageCount];
for (int i = 0; i<images.length; i++) {
println(images.length); //prints the expected result 1
images[i] = loadShape("platzhalter/Platzhalter_2_"+str(i)+".svg");
// throws NullPointerException
}
}
I hope someone here can help me, thx!