//inititalize variables and values int f = 0; int b = 255; void setup(){ size(400,400); smooth(); frameRate(30); println("This is an arrow"); } void draw(){ fill(f); stroke(0); strokeWeight(4); strokeJoin(MITER); background(b); // draw shapes quad (191,218,214,208,265,317,242,327); triangle (140,60,140,240,265,185); // create condition according to mouse position if (( mouseX >= 140) && (mouseX <= 265) && (mouseY >=60) && (mouseY <=327)) { f = 255; b = 0; } else{ f = 0; b = 255; } } /*it s seems that is working quaite well but the problem is how to define the area of interaction not by a square but by the shape itself ? */