Circles disappears with absolute value

Hey!

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(){
gui.draw();

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

ofSetColor(255,255,255);
ofDrawCircle(120,80,20);
ofDrawCircle(200,80,20);
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