xxxxxxxxxx
35
var img;
var imgClone;
var mk;
// based on the original sketch by oshoham
function setup() {
createCanvas(windowWidth, windowHeight);
noStroke();
img = createGraphics(width, height);
img.fill(200);
img.noStroke();
img.ellipse(100, 100, 100 + 2, 100 + 2);
mk = createGraphics(width, height);
mk.rect(0, 0, 125, 125);
( imgClone = img.get() ).mask( mk.get() );
}
function draw() {
background(200);
noStroke();
fill(255);
ellipse(100, 100, 100, 100);
image(imgClone, 0, 0);
}