xxxxxxxxxx
32
var img;
var imgTemp;//horrible to do this but...
var mask;
var ctx;
function setup() {
var desiredWidth = 256 * 2;
var desiredHeight = 256 * 2;
createCanvas(desiredWidth, desiredHeight);
img = loadImage('porsche.png');
img1 = loadImage('porsche.png');
mask = createGraphics(desiredWidth, desiredHeight);
}
function draw() {
background(220);
mask.clear();
mask.fill(255);
mask.ellipse(mouseX, mouseY, 128);
//mask.rect(mouseX, mouseY, 128, 128);
img1.copy(img, 0, 0, width, height, 0, 0, width, height);
img1.mask(mask);
image(img1, 0, 0, width, height);
fill(0, 255, 0);
text(frameRate(), 10, 10);
}