We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello all,
I need to use mousePressed versus mouseDragged - both are needed.
What is the right order?
What I need:
So I use mousePressed and then set mouseHold to true
but how can I distinguish if it has been dragged or just clicked (in the function mouseReleased)?
Thank you all!
Greetings, Chrisir
Answers
Create a boolean variable called
beingDraggedand initialise it to false.In
mouseDraggedset it to true.In
mouseReleasedtest it to see whether the mouse had been dragged. In any case set it to false before leaving the method to reset it.Thanks, quark!
I got confused because I used mouseClicked first which doesn't go together with mouseDragged...
now my order is:
don't use mouseClicked ...
Also in draw() I say: When beingDragged show apple at mouse-position...
Thanks a lot!
Greetings, Chrisir