xxxxxxxxxx
var img;
var frame = 0;
var numframes = 8;
function preload() {
img = loadImage('face40x8.png');
}
function setup() {
createCanvas(windowWidth, windowHeight);
background(100);
}
function draw() {
background(255);
blend(img, frame*40, 0, 40, 40, mouseX, mouseY, 80, 80, BLEND);
frame = (frame+1)%numframes;
}