xxxxxxxxxx
var img;
var images = [];
var currimg = 0;
function preload() {
images.push(loadImage("IMG_20120706_200631.jpg"));
images.push(loadImage("IMG_20120713_153752.jpg"));
images.push(loadImage("IMG_20120726_203459.jpg"));
images.push(loadImage("IMG_20120711_232811.jpg"));
images.push(loadImage("IMG_20120815_201558.jpg "));
img = images[0];
}
function setup() {
createCanvas(windowWidth, windowHeight);
noStroke();
textAlign(CENTER, CENTER);
textSize(70);
}
function draw() {
var t = frameCount * 0.01 + sin(frameCount * 0.01);
var sz = 0.7 + 0.7 * sin(t*1.11)
var sx = img.width*0.5 + 0.4 * sin(t)*img.width;
var sy = img.height*0.5 + 0.4 * cos(t)*img.height
var tx = width*0.5 + sz*sin(t*3.5)*width/2;
var ty = height*0.5 + sz*cos(t*3.5)*height/2;
copy(img, sx, sy, 40, 40, tx, ty, 40, 40);
fill(0, 10);
text("Works by\n" + "Diogo, Elizabeth\n" +
"Guillame, Hyunseo\n" + "Michelle, Zara\n" + "Stanley, Varvara",
width/2+random(-5, 5), height/2 + random(-5, 5));
fill(255);
text("Works by\n" + "Diogo, Elizabeth\n" +
"Guillame, Hyunseo\n" + "Michelle, Zara\n" + "Stanley, Varvara",
width/2, height/2);
if(frameCount % 900 == 0) {
currimg = (currimg + 1) % images.length;
img = images[currimg];
}
}