Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

Image generator, how to add tags?

$
0
0

Hi guys,

This is my image generator with png's. There will be 3 different "tags", my question is how can I have tags in my code for people to chose with images are going to be combined?

PImage[] myImageArray = new PImage[5];
PImage[] myImageArray2 = new PImage[5];
//PImage[] myImageArray3 = new PImage[5];

void setup() {
  size(100, 100);
  background(255);


  for (int i=0; i<myImageArray.length; i++) {

    myImageArray[i] = loadImage  ( "b" + i + ".png");
    myImageArray2[i] = loadImage  ( "a" + i + ".png");

    // myImageArray3[i] = loadImage( "c" + i + ".png");
  }
  display();
}
void display() {

  int b = (int)random(4);
  image(myImageArray[(int)random(myImageArray.length)], 0, 0, 100, 100);
  int a = (int)random(4);
  image(myImageArray2[(int)random(myImageArray.length)], random (15), random (15), 100, 100);
  // int c = (int)random(10);
}
void draw() {
}
void mousePressed() {
  display();
  background (255);
  display();
}

Viewing all articles
Browse latest Browse all 2896

Trending Articles