Panels and masking, or "how do I get MouseCallbacks to only be responsive to certain areas of a panel?" SVGpaths?
-
Hello.
I have a beginner's general question about how to get MouseCallbacks to only be reactive to a portion of a panel, such as parallelograms or even non-rectangular areas. Is there a way to mask a panel? Or make a panel that is not made up by 90° rectangles?
I want to implement some hover effects on the skewed squares seen in the picture below, such that they change color on event.hover.
Is there a way to make (non-rectangular) SVGs set the boundaries of the MouseCallbacks?
-
You'll need to use good ol' fashioned maths for this - https://forum.hise.audio/topic/11170/trapezoid-xy-pad
-
@andersnaessss There's also a
Path.contains()
method so if you have the path (even if you don't draw it) you can perform a check for mouse positionEDIT: found the post: https://forum.hise.audio/topic/7986/how-to-detect-if-inside-ellipse/11?_=1736869127225