Circles disappears with absolute value


I’m trying to make the white small circles disappear when I hover over them with the larger yellow circle.
I am thinking the best way to do this is with the absolute value linked with the radius of the small circles somehow, but I am not sure.

I drew the circles with gui so you can change the position of the yellow circle yourself.

void ofApp::draw(){

ofSetColor(255, 195, 22);
ofDrawCircle(posX, posY, 50);

ofDrawCircle(280, 80,20);
ofDrawCircle( 360, 80,20);


Please help!

You need a simple class to store your circle. Here is an example which print something when the big yellow circle is over the small one. You should store your small circles in array / vector and when the big circle is over the small one you can remove it from array/vector.

ofxMyCircle.cpp (720 Bytes)
ofApp.cpp (1.5 KB)
ofApp.h (482 Bytes)
ofxMyCircle.h (401 Bytes)

Thank you!!

Here is the whole app.

1 Like