• fullscreen
  • sketch13240.pde
  • void setup(){
      size(400,400);
      smooth();  
      background(0);
    }
    int prevX,prevY=0;
    int value = 0;
    void draw(){
    
      line(prevX,prevY,mouseX,mouseY);
      stroke(255);
      prevX = mouseX;
      prevY = mouseY;
    
      if (mousePressed && mouseButton == RIGHT){
        background(0);
        value = 0;
        strokeWeight(value);
    
      }
    
    
    }
    
    void mouseDragged() 
    {
      strokeWeight(value);
      value = value + 1;
      if (value > 100) {
        value = 0;
      }
    }
                    

    code

    tweaks (0)

    about this sketch

    This sketch is running in HTML5 using Processingjs.

    license

    advertisement

    Ferhat Sen

    Intelligent BW Painter

    Add to Faves Me Likey@! 2
    You must login/register to add this sketch to your favorites.

    Left mouse increases the brush size until a certain point, and then it resets to 1. Right mouse button clears the canvas

    You need to login/register to comment.