detect hover over irregular shapes

Beep's icon

Hi all, I want to split a ring up into 12 sections and then detect which section is being hovered over with the mouse. Is there any way of detecting a mouse hover over any other shape except a rectangle?

Many thanks

Beep's icon

p.s I don't want to use [ubutton] as this is effectively still a rectangle.

Letraset Catalogue's icon

jit.window or patcher?

Beep's icon

Thanks for the reply, not sure how [patcher] would help? jit.window will help me draw irregular shapes, and I know it reports "mouseidelout" but not sure how to report on the presence of a mouse over that irregular shape?

Andrew Pask's icon

Maybe you could create a "clickmap" type image and load it into a jit.matrix the same size as your patcher. Getcell at the same coords will give you a particular colour output

-A

Letraset Catalogue's icon
Max Patch
Copy patch and select New From Clipboard in Max.

like this?

Beep's icon

WOW! That is utterly awesome, thank you! I know this is cheeky, but would it be possible for you to add a few notes to the patch to help me understand some of the math? I really am so grateful for this!

Letraset Catalogue's icon
Max Patch
Copy patch and select New From Clipboard in Max.

The torus is just making the location visible.

Andrew Pask's icon

Yes, that sort of idea. Nice one.

I was thinking that you would not see the "map" image, it could be a custom graphic created the same size as the ui in your patcher, the patcher could refer to it to get color or something based on the position of the mouse in the patcher.

-A

matmat's icon

hi,
May be "jit.gl.picker" can do the job ?

Mark Durham's icon