How to clear the screen on mouse click
Answered
- Need more info
- Answered
- Working on it
              in 
             Programming Questions 
              •  
              3 years ago    
            
 
           
             Hi sorry to ask such an elementary question but I am new to processing and really need help. Suppose I run this code this in Processing:
            
             
              
             
            
            
 
            
           
              void setup ()
             
             
              {
             
             
              size (400, 400);
             
             
              background (125);
             
             
              stroke (1);
             
             
              }
             
             
              void draw ()
             
             
              {
             
             
              // pmouseX, pmouseY: previous pointer coordinates
             
             
              // mouseX, mouseY: current pointer coordinates
             
             
              line (pmouseX, pmouseY, mouseX, mouseY);
             
             
              }
             
             
             It will use the variables to draw a line that follows the movement of the pointer around the program window.  I need to modify the code so that Processing clears the screen whenever I click the mouse button. Any advice would be greatly appreciated, Thank you.
             
             
[Moderator's note: I renamed the title from "Question need help asap" which isn't informative at all on the nature of the question... Also marked the thread as answered, even if very few people do it actually...]
            
 
           [Moderator's note: I renamed the title from "Question need help asap" which isn't informative at all on the nature of the question... Also marked the thread as answered, even if very few people do it actually...]
 
              
              1  
            
 
            
 
 
           
 
             
 
             
 
            