How to detect mouse over GUI

Hi everyone

I'm using p5.gui (https://github.com/bitcraftlab/p5.gui) to control a sketch featuring communication with Max/MSP via jweb object (http://paweljanicki.jp/projects_maxandp5js_en.html).

This is my first time working in javascript and so I wonder how is it possible to find out the current GUI coordinates to check if the mouse is over the GUI or not.

Here is the code: https://www.sendspace.com/file/0e7vtg

I imagine that it needs to be done inside Draw, so that the variables reflect the displacement of the GUI over the screen according to user input. I can't figure out however how to recall such properties from the p5.gui library within my main sketch.

(I also wonder if what I need to do is to create various canvas as in here? http://www.joemckaystudio.com/multisketches/)

Any hints on this would be very much appreciated.

All the best,

Tagged:
Sign In or Register to comment.