GMU:Processing im Park/Emilio Aguas/Code Brushes

From Medien Wiki

--- Processing3.0 Code---

PImage myBrush, myMask;
int centerX=65;
int centerY=80;

void setup() {
  size (600, 600);
  background (255);
  myBrush= loadImage("IMG_0038.JPG");
  myMask= loadImage("IMG_0038_alpha.jpg");
  myBrush.mask(myMask);
  frameCount=20;
  //noCursor();
  smooth();
}

void draw () {
  if (mousePressed == true) {
    tint(200);
    pushMatrix();
    translate(PI/2,PI/4);
    rotate (random(frameCount++));
    image(myBrush, mouseX -centerX, (mouseY -centerY)*-1, width/8, height/8);
    popMatrix();
  }
}