Nifty labels inside a scrollPanel control

My game implements a head-up display using Nifty. When I upgraded from RC2 to 3.0Stable, the HUD’s appearance changed for the worse, with all the labels in the scrollPanel becoming invisible illegible. I’ve written a small test app which demonstrates the issue:

package mygame;

import com.jme3.niftygui.NiftyJmeDisplay;
import de.lessvoid.nifty.Nifty;


  • A simple JME3 app to demonstrate the Nifty scrollPanel control.
    public class Main extends SimpleApplication {

    public static void main(String[] args) {
    Main app = new Main();

    public void simpleInitApp() {
    NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager,
    inputManager, audioRenderer, guiViewPort);
    Nifty nifty = niftyDisplay.getNifty();
    String interfaceAssetPath = “Interface/hud.xml”;

Here’s the hud.xml file:
<?xml version=“1.0” encoding=“UTF-8”?>
<nifty xmlns=“
<useStyles filename=“nifty-default-styles.xml”/>
<useControls filename=“nifty-default-controls.xml”/>

&lt;screen id="hud"&gt;
    &lt;layer childLayout="horizontal"&gt;
        &lt;panel childLayout="vertical"
            &lt;control name="scrollPanel"
                &lt;panel childLayout="vertical"
                    &lt;control name="button"
                             label="a button label"/&gt;
                    &lt;control name="label"
                             text="some green text"/&gt;


Can anybody explain why the labels are invisible / illegible?

Do the labels look fine when not inside the scroll panel?

1 Like

@zarch: yes, they look fine that way.

Odd. I don’t use the nifty scrollpanel myself so you may need to see if someone who does (or @void256) comes along.

1 Like

Just for the record it looks like this:

(I’ve added the button and label outside the scrollpanel where it renders ok)

The problem seems to be the blendMode=“multiply” which is applied in the standard-style for the scrollpanel. This somehow makes anything inside the scrollpanel to render without texturing enabled and/or missing texture coordinates when used in jme3.

I don’t know why (yet). I’m pretty sure we had that problem before but I can’t remember what we did the last time it occured :wink:

There is a workaround however. Just add that snippet to your xml somewhere before the screen tag:



And then apply that style to your scrollpanel control:



Thanks, @void256! The workaround you suggested resolves this issue in my game … though I did have to change “onactive” to “onActive”.

1 Like

Begging your pardon, @void256, but I guess I’m unclear: where would I report this issue? To or to ?

This specific issue is best reported as a jME specific issue: since the problem is in the jME-Nifty integration code. Not sure if this can actually be fixed properly (besides the workaround posted above).


Thanks, @void256. I’ve filed this as a new issue (#609).

i ran into the same issue.
The posted solution above works, however the scrollbar changes its color from red to grey as soon as i start to drag an image.

Coudl you @void256 provide me a hint? I would really appreciate :slight_smile:

1 Like