We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I am trying to write a code where pressing the mouse shows and blends two random images from an array of 10. If this is possible, I can't really get my head around how to create the array's and call them in draw.
Any pointers would be appreciated!
`//VARIABLES PImage[] photo = new PImage[9]; PImage[] photo2 = new PImage[9];
//SETUP void setup () { size(600,600);
photo[0] = loadImage("Photo1.png"); photo[1] = loadImage("Photo2.png"); photo[2] = loadImage("Photo3.png"); photo[3] = loadImage("Photo4.png"); photo[4] = loadImage("Photo5.png"); photo[5] = loadImage("Photo6.png"); photo[6] = loadImage("Photo7.png"); photo[7] = loadImage("Photo8.png"); photo[8] = loadImage("Photo9.png"); photo[9] = loadImage("Photo10.png"); }
//DRAW void draw() { if(mousePressed) { photo.blend(photo2,0,0,600,600,0,0,600,600,ADD); image(photo,0,0); } }`
Answers
Thanks so much Chrisir, don't think I'd have got there alone!
you're welcome !