Background(image) not working

void mousePressed() {
  if ( state == 0 ) {
    if ( over(x1, y1, w1, h1) )  state = 1;
    if ( over(x2, y2, w2, h2) )  state = 2;
    if ( over(x3, y3, w3, h3) )  state = 3;
    if ( over(x4, y4, w4, h4) )  state = 4;
  } else {
    if ( over(x5, y5, w5, h5) )  state = 0;
  }
}

should work same as the switch???

1 Like