Second JMEDesktop in a GameState/Scene ignoring first click

In a scene, I want to use 2 JMEDesktops, because I'd like to move them around independently, and I like to have them both semi-transparent where no Component is placed (much like in TestJMEDesktop). Basically, I'm using 2 JMEDesktops because I don't know how to create these 2 independent parts on one desktop :wink:



It seems to me that when the desktop which has been created second, it doesn't respond to the first click. When that click hits a button, for example, the button isn't optically pushed in, and no event reaches the corresponding ActionListener. But once the desktop (anything, or even free space, on it) has been clicked, it behaves correctly. It seems that the desktop needs the first button pressed event in order to get active. I can (manually) work around this by moving the mouse a bit (on the button), then the button is correctly pressed and an event occurs.



This only happens to the second desktop in this GameState (there's a third desktop in another GameState, which works correctly), and probably to every further desktop in this state (I can check that if it's needed).



I know that multiple desktops aren't officially supported, but maybe someone knows a way around this.

I dealt with this issue in RR but fortunately for me it was six desktops on a rotating cube and only one was visible at a time.  The way I worked around it though was to have an InputHandler per desktop and disable all but the one that is currently visible.  That resolved my issues, but this is something that has been a problem for a while.

darkfrog said:

I dealt with this issue in RR but fortunately for me it was six desktops on a rotating cube and only one was visible at a time.  The way I worked around it though was to have an InputHandler per desktop and disable all but the one that is currently visible.  That resolved my issues, but this is something that has been a problem for a while.

Unluckily, that won't work for me, because both desktops have to be accessible at the same time. :(

Unless of course you added (albeit hacky) a system to detect which desktop the mouse cursor was hovering over and enabled that one and disabled all others?  :expressionless:

darkfrog said:

Unless of course you added (albeit hacky) a system to detect which desktop the mouse cursor was hovering over and enabled that one and disabled all others?  :|

I'll think about this, but it seems awkward. Maybe I'll find a way to put the two panels into a desktop and have them both partially transparent at the same time.

If you use JMEDesktopGameState it puts a billboardnode that extends across the entire viewable area that you can put internal frames inโ€ฆif you don't care about it being 3D then that might be a good solution?

darkfrog said:

If you use JMEDesktopGameState it puts a billboardnode that extends across the entire viewable area that you can put internal frames in.....if you don't care about it being 3D then that might be a good solution?

My current solution isn't 3d either, it's just panels along the sides with your controls (as in many strategy games today). But I think I won't manage making it semi-transparent (ColorRGBA(1, 1, 1, 0.3)).

Maybe I misunderstood your problem, but transparency on JMEDesktop works just fine. I use a JMEDesktop spanning the whole screen so that the user can put the windows where he wants.

Beside the compass display in the top right corner every GUI element here http://www.world-of-mystery.de/client/index.php?p=gallery&pic=screen00013a is JInternalFrame or a JFrame.

The transparency in this example is 0.75.