Preventing the delivery of mouseevents to underlaying elements


how do i prevent the delivery of mouseevents to underlying elements?

only the topmost element should get the event, the underlaying elements not.

Maybe this is related to your issue?

Actually that should work with Nifty 1.3 out of the box. I think that was changed before the 1.3 release with the addition of multiple mouse button support to Nifty. Do you use 1.3? Can you provide a MINIMAL (please, a minimal! :slight_smile: example?

“Maybe this is related to your issue”

not that much, but thank you:)

im using nifty- & default-controls 1.3.1, the newest from trunk.

an example:


<screen id=“screen-main”>

<layer id=“layer-menu” childLayout=“vertical” >

<panel id=“panel-obscured” visibleToMouse=“true” backgroundColor="#FF000077" childLayout=“vertical” width=“200px” height=“200px” >


<onHover name=“colorPulsate” startColor="#FF000077" endColor="#FF0077" cycle=“true” period=“500” />




<layer id=“layer-billboard” childLayout=“vertical”>

<panel id=“panel-above” visibleToMouse=“true” backgroundColor="#FF114477" childLayout=“vertical” width=“100px” height=“100px” >


<onHover name=“colorPulsate” startColor="#FF114477" endColor="#00FF77" cycle=“true” period=“500” />






panel-above covers panel-obscured, but when the mouse is hovering on panel-above than the effect of panel-obscured is triggered too.

it doesn´t matter if the containers of the both panels are panels.

ok, I can confirm this. hover effects are processed for all elements. every other interaction (clicking on elements, etc.) should block correctly (this was the part that has been changed in Nifty 1.3).

not sure how to fix this yet and not sure if there are cases where you actually want that behaviour. I’ll need to meditate a bit about this :slight_smile:

k :).

use case:

im using a console for debugging. the console is hidden but moves out by pressing F1.

the console is transparent and lies when it becomes visible above some buttons with an onHover effect.


it is a good idea to use nifty to show some speechbubbles or the health status?

when im using nifty the app gets much slower.

I’m working on some things to speed up Nifty internally but it might take some time before they will be finished and available. Not sure what we can do about the speed of the jme3 nifty renderer. It’s a bit slower than the native LWJGL one, unfortunatly.

The speed issues aside Nifty was meant to be used for in game GUIs! So in general I would consider speechbubbles and healtstatus to be done in Nifty considering that the speed issues eventually will be fixed sooner or later…