I'm new to processing so excuse me if I'm asking a stupid question.
I've been looking around a bit, but cannot figure out the answer.
I've been looking around a bit, but cannot figure out the answer.
I have an image with a green area (0,255,0) on it. I also have an red ellipse.
Now I want that when the red ellipse moves over / touches the green area, something will happen.
I made an array of the image, because I don't know how else to find the green area. And from the ellipse I have only the coordinates.
ellipse(mouseX,mouseY,30,30);
img = loadImage(image.png);
img.loadPixels();
for (int i = 0; i < img.pixels.length; i++)
{
if(img.pixels[i] == color(0,255,0))
}
Now I don't know how to make the interaction between those two.
I want to get that when the red circle is on the green area, he will do something.
I want to get that when the red circle is on the green area, he will do something.
Does anyone know how I can solve this?
1
