Posted By

S_Park on 08/04/10


Tagged

input mouse line draw


Versions (?)

Line Drawing (mouse speed)


 / Published in: Processing
 

Draw line on mousedown.\r\nLine width based on mouse movement.

  1. void draw() {
  2. stroke(255);
  3. strokeWeight(abs(mouseX-pmouseX));
  4. if (mousePressed && mouseButton == RIGHT) {
  5. background(0);
  6. println (mouseButton);
  7. } else if (mousePressed && mouseButton == LEFT) {
  8. line(pmouseX,pmouseY,mouseX,mouseY);
  9. }
  10. }

Report this snippet  

You need to login to post a comment.