I have created an erase button in Processing with controlP5 library. The purpose of the erase button is, to erase when something is drawn with the mouse (when erase button is clicked). Similar to the paint program.
Thank you very much in advance!
Code for erase Button function:
**boolean erase = false;
void setup(){
}
void draw(){
void keyPressed(){ //there is an error in this line (error on void)
if (keyPressed == true && erase == true) {
background(255);
}
}
}**