(Delete) Any Image Created Through Clicks

Hi, I’m trying to create a program that makes it so every new click reveals a rectangle in a specific region. When all of the clicks are done, then all the rectangles will be revealed- showing an image. Basically pixel art. I’m not sure what function I would use to have each click create a rectangle in just that specific area. This is the code that I’ve done so far, but I’m stumped with the floating function.

void setup() {

void draw() {
  if (mousePressed) {

Hi, @Matrix Please edit your code above by selecting it and pressing the </> button.
You can use the flexable PVector ArrayList for that, storing the mouseX and mouseY values in it.
ArrayList <PVector> mouseClicks = new ArrayList<PVector>();
The when you are done, press a key and draw the rectangles on the canvas.
See PVector and ArrayList