How to detect mouse over GUI

Hi everyone

I'm using p5.gui ( to control a sketch featuring communication with Max/MSP via jweb object (

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:

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?

Any hints on this would be very much appreciated.

All the best,

Sign In or Register to comment.