GMU:Processing im Park/Sina Stolp/slideshow code

From Medien Wiki
< GMU:Processing im Park‎ | Sina Stolp
Revision as of 17:20, 2 January 2016 by Stolpertz (talk | contribs) (Created page with "<source lang="java"> PImage img1; PImage img2; PImage img3; PImage img4; PImage img5; PImage img6; PImage img7; PImage img8; PImage img9; int frame; void setup() { size(400...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
PImage img1;
PImage img2;
PImage img3;
PImage img4;
PImage img5;
PImage img6;
PImage img7;
PImage img8;
PImage img9;

int frame;

void setup() {  
  size(400, 400);
  background(0, 0, 0);
  frameRate(3);
  frame = 1; 

  img1 = loadImage("r1.jpg");
  img2 = loadImage("r2.jpg");
  img3 = loadImage("r3.jpg");
  img4 = loadImage("r4.jpg");
  img5 = loadImage("r5.jpg");
  img6 = loadImage("r6.jpg");
  img7 = loadImage("r7.jpg");
  img8 = loadImage("r8.jpg");
  img9 = loadImage("r9.jpg");
}

void draw() {
  if (frame > 9) {
    frame = 1;
}

if (frame == 1) {
  image (img1, 0, 0, 400, 400);
}
if (frame == 2) {
  image (img2, 0, 0, 400, 400);
}
if (frame == 3) {
  image (img3, 0, 0, 400, 400);
}
if (frame == 4) {
  image (img4, 0, 0, 400, 400);
}
if (frame == 5) {
  image (img5, 0, 0, 400, 400);
}
if (frame == 6) {
  image (img6, 0, 0, 400, 400);
}
if (frame == 7) {
  image (img7, 0, 0,400, 400);
} 
if (frame == 8) {
  image (img8, 0, 0,400, 400);
}
if (frame == 9) {
  image (img9, 0, 0, 400, 400);
}
frame = frame + 1;
}