Quantcast
Viewing all articles
Browse latest Browse all 40524

How to use the mouseDragged event?

Hi,

I always find it easy, when I am not sure exactly what a function does, to test it with printing output to the console.

For example here you could use this

void ofApp::mouseDragged(int x, int y, int button){

	cout << "test   " << x << " , " << y << endl;
}

To see that when you click and hold the mouse the function will constantly fire (like the update function), but only when the button is pressed. The x and y values will refer to the position of the mouse in the viewport.


Viewing all articles
Browse latest Browse all 40524

Trending Articles