I'm just playing around building a simple game that shows and image and erases it as you drag your cursor over the image. To do this I'm using an array of rectangle objects that each monitor if they've been dragged over, and if they have been, turn white thus covering the background image. So I draw the blocks, set them to transparent fill(0,0); then change the fill to 255 when it is dragged over. This works fine when I set the blocks to black, then change them to white on drag, however if they are set to transparent then change to white the array or something goes CRAZY. Might be easier to see in code:
PImage b;
int canvasx = 500;
int canvasy = 500;
int cellsize = 50;
int arraynumx = floor((canvasx/cellsize));
int arraynumy = floor((canvasy/cellsize));
sensor[] [] toucher = new sensor[cellsize] [cellsize];
int counter = 0;
void setup() {
b = loadImage("dk.jpg");
size(canvasx, canvasy);
background(b);
noStroke();
for (int j = 0; j < cellsize-1; j ++) {
for (int i = 0; i < cellsize-1; i ++) {
toucher[i] [j] = new sensor(i*cellsize, j*cellsize);