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”>
<useStyles filename="nifty-default-styles.xml" />
<useControls filename="nifty-default-controls.xml" />
<resourceBundle id="menu" filename="Properties/menu" />
<!--*******************************************
Index screen
Selected profile
********************************************-->
<screen id="index" controller="mygame.guicontroller.MenuGUIController">
<!-- Foreground -->
<layer id="foreground" childLayout="vertical" visibleToMouse="true">
<!-- Dropdown list of profile -->
<panel id="scrollPanel" align="center" childLayout="center" height="60%" width="95%">
<control name="scrollPanel" id="GScrollPanel0" vertical="true" height="100%" horizontal="false" width="100%" stepSizeY="40">
<panel id="GPanel0" height="${CALL.getScrollPanelHeight()}" width="100%" childLayout="vertical" y="0" x="0"/>
</control>
</panel>
</layer>
</screen>
</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 !!!