Help needed with Random background Images
in
Programming Questions
•
1 years ago
Hi, I'm hours new to Processing.
I was wondering if I could have some support.
I was wondering if I could have some support.
I'm trying to create a button that makes the background image change randomly.
For some reason I'm finding this incredibly hard.
String[] words = { "i1.png", "i2.png", "i3.png", "i4.png", "i5.png", "i6.png", "i7.png" };
int index = int(random(words.length)); // same as int(random(NUMBER))
(words[index]);
This is the pile of junk I have so far.
1