Nifty JME3 problem

I started doing GUI for my game. There is some things that are bothering me:

I start my game with nifty gui attached to sceneProcessor. When the player clicks on “Play” button, I detach nifty gui from sceneProcessor and enable fly camera. The problem is, that although I cannot see nifty menu anymore, the mouse is not hidden and when I click around a little, I notice that gui events are being processed. Its like there is still nifty gui on screen, although its not visible.

How can I solve this?

inputManager.setMouseVisible(false)

You can create a screen that contains no elements, then go to it, instead of simply detaching the nifty processor

1 Like

Ok I somehow got that working now (thanks to Momoko_Fan).

Anyway, now I have new problem. When user clicks on a button in nifty-gui, I want to go to play mode and attach some visuals, but that kinda doesn’t work. If I enqueue calls for attaching my geometry to the root node, I still cant see anything. What should I do?

Ok it was my problem, fixed it.

But its still unclear to me, do we have to enqueue calls from nifty or not (in MonkeyZone, there are some enqueued calls and some not…)?

Nifty calls are executed on the OpenGL thread, all methods that are solely called from the nifty gui in MZ are un-queued.