Using a component as a frame-mask (?)

I would like to use a component to mask an other component underneath it. But I want to still use the sliders and buttons of the one underneath, using the one on top as just something visible (a “mask”). Of course I want to see through it, but obviously a simple alpha masking (done on the mask component by subtracting a path from a rectangle) didn’t work. It’s like making a wall invisible but the wall is still there.
Can anybody help me to get through it or… what other solution would you go for?
I want to use a mask because I have some objects (panels) that swipe around as you open-close them. I want them to disappear from the screen through a rounded rectangular frame.
Thanks for reading this far.

You can simply keep the component transparent setOpaque (false); which is the default afaik.
For the mouse clicks you can set setInterceptsMouseClicks (false, true); to make it ignore mouse events. It’s children will react just normal though (can be disabled as well with the second parameter).

HTH

1 Like