My first step was to create the circle and an if statment for when the circle is clicked. This means i have to limake the mouse clicked area only inside the circle. In order to test i have done this, for the time being i made it so that if the circle was clicked it would go white. so i would know if i have been successfull.
You have to tell the mouse where to click, 
if(mousePressed && mouseX > centerX-r/2 && mouseY > centerY-r/2&& mouseX < centerY+r/2 && mouseY < centerY+r/2)
{
  drawSomething();
 }
}
void drawSomething()
{
  fill(255);
  ellipse(centerX,centerY,r,r);
}

No comments:
Post a Comment