Hi there !
Glad to write my first post in this warm community
I’m kind of stuck on a pretty simple issue regarding update loop and event trigger.
Basically, I need to send an OSC message and updating a Tween (not using ofxEasing here) only when the mouse collide a rectangle.
So far I’ve used something similar to this inside the update function :
if (rect.inside(mouseX, mouseY)) {
isInside = true;
}
if (isInside) {
ofxOscMessage m;
m.setAddress("/bang");
m.addIntArg(1);
sender.sendMessage(m);unsigned delay = 0;
unsigned duration = 1000;
tweenback.setParameters(1,easingback,ofxTween::easeOut,0,100,duration,delay);
}
How would you go to trigger an event only once when the mouse cursor is inside an ofRectangle ?
Thanks in advance