In one of my project, I have a main Component that contains 2 images (black screen). I have a class ‘My2DScreen’ that inherits Component and Graphics. I create 2 2DScreen inside those images, and I’d like to make the mouseDown() redefined in ‘My2DScreen’ called whenever I click on one of those component.
However, it is indeed the mouseDown() of my mainComponent that is called and if I try "Logger::outputDebugString(e.source.getComponentUnderMouse()->getName()); I get the name of the main Component instead of the one of the 2DScreen.
I’ve tried setInterceptsMouseClick() on both components, and setAlwaysOnTop() on the 2DScreen but it doesn’t change anything.
Is there anything I can do?