Strange rendering on a scrollpanel

Dear all,

I have a very strange problem. When a render something on a ScrollPanel, the result is not what i expect:

As you can see, the font is really weird. And I use regular font (right-click on assert -> new -> Font…).
Please, find the code below :

XML :
[java]<?xml version=“1.0” encoding=“UTF-8” standalone=“no”?>
<nifty xmlns=“http://nifty-gui.sourceforge.net/nifty-1.3.xsd
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance
xsi:schemaLocation=“http://nifty-gui.sourceforge.net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd”>

&lt;useStyles filename="nifty-default-styles.xml" /&gt;
&lt;useControls filename="nifty-default-controls.xml" /&gt;
&lt;resourceBundle id="menu" filename="Properties/menu" /&gt;

&lt;!--*******************************************
               Index screen
             Selected profile
********************************************--&gt;
&lt;screen id="index" controller="mygame.guicontroller.MenuGUIController"&gt;
    &lt;!-- Foreground --&gt;
    &lt;layer id="foreground" childLayout="vertical" visibleToMouse="true"&gt;
        &lt;!-- Dropdown list of profile --&gt;
        &lt;panel id="scrollPanel" align="center" childLayout="center" height="60%" width="95%"&gt;
            &lt;control name="scrollPanel" id="GScrollPanel0" vertical="true" height="100%" horizontal="false" width="100%" stepSizeY="40"&gt;
                &lt;panel id="GPanel0" height="${CALL.getScrollPanelHeight()}" width="100%" childLayout="vertical" y="0" x="0"/&gt;
            &lt;/control&gt;
        &lt;/panel&gt;
    &lt;/layer&gt;
&lt;/screen&gt;

</nifty>[/java]

And the Java code:
[java]public void bind(Nifty nifty, Screen screen) {
// Create the list of profile
Screen index = nifty.getScreen(“index”);
Element element = index.findElementByName(“GPanel0”);
for(int i = 0; i < profileSize; i++) {
final int b = i;
// Panel for color, text & button
new PanelBuilder(“prof” + i) {{
childLayoutHorizontal();
height(profileHeight + “px”);
// Button Delete
control(new ButtonBuilder(“deleteButton_” + b) {{
// interactOnClick(“showPopup(popupDeleteProfile)”);
alignLeft();
marginLeft(“10px”);
valignCenter();
// style(“nifty-delete-button”);
}});
// Text
text(new TextBuilder() {{
width(“80%”);
valignCenter();
font(“Interface/NiftyXML/aurulent-sans-36-bold-with-shadow.fnt”);
text(“PROFILE_X”);
}});
// Button Select
control(new ButtonBuilder(“selectButton_” + b) {{
// interactOnClick(“toScreenId(characterScreen)”);
alignRight();
width(“10%”);
valignCenter();
label(“select”);
}});
}}.build(nifty, index, element);
}
}[/java]

Can someone help me ?
Thank a lot !!!

There’s a bug in JME render that causes wired fonts . Here is the discussion with also a workaround , I hope it helps! :slight_smile:

2 Likes

And it works :slight_smile:

Thank you a lot !

1 Like