Problem with inserting an image array

Hi everyone, one question:
if I have an array of images, for example
PImage [] dogs = new PImage [4]
then inserting each image:
dogsOne = loadImage ("");

then when I have to insert my images in image (… 0,0,100,100);
how do I insert the array?

Why I tried to insert it by putting = dogs but it says “impossible to insert array”

Thank you

1 Like

before setup()

PImage [] dogs = new PImage [4];

in setup():

dogs[0] = loadImage ("test1.jpg");
dogs[1] = loadImage ("test2.jpg");
dogs[2] = loadImage ("test3.jpg");
dogs[3] = loadImage ("test4.jpg");

Display an image in draw()

in draw() or anywhere image(dogs[0], 30,30);

Chrisir

2 Likes

for example when you have an image array for the levels

image(dogs[levelNumber], 33,33);

3 Likes

thank u :slight_smile:

1 Like