GMU:Processing im Park/Emilio Aguas/Code Brushes

From Medien Wiki
< GMU:Processing im Park‎ | Emilio Aguas
Revision as of 15:52, 27 December 2015 by EmilioAguas (talk | contribs) (Created page with "====--- Processing3.0 Code--- ==== <source lang="java"> PImage myBrush, myMask; int centerX=65; int centerY=80; void setup() { size (600, 600); background (255); myBrush...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

--- 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();
  }
}