Hi,
sorry to bother again, but I read nifty-gui download | SourceForge.net and searched the forum, I still dont understand what I’m doing wrong with nifty-popups:
When I understand it correct…
[java] Element element = nifty.createPopup(“niftyPopup”);
nifty.showPopup(nifty.getCurrentScreen(), element.getId(), null);
[/java]
should search on ‘niftyPopup’-tag in my .xml, where I have:
[java]<nifty xmlns=“http://nifty-gui.sourceforge.net/nifty.xsd” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=“http://nifty-gui.sourceforge.net/nifty.xsd http://nifty-gui.sourceforge.net/nifty.xsd”>
<useStyles filename="nifty-default-styles.xml" />
<useControls filename="nifty-default-controls.xml" />
<screen id="start" controller="mygame.Main">
<layer id="layer" childLayout="center">
// …my other screen stuff
</panel>
</layer>
</screen>
<popup id=“xniftyPopupMenu” childLayout=“center”>
<panel height=“50%” width=“50%” childLayout=“vertical” visibleToMouse=“true”>
<panel height=“20%” childLayout=“center” backgroundColor=“#f00f” />
<text id=“popup_text0” font=“ui/fonts/palatino.fnt” color=“#000f” align=“center” valign=“center” text=“1530”/>
<panel height=“20%” childLayout=“center” backgroundColor=“#00ff”/>
<panel height="30%" childLayout="center" backgroundColor="#ff0f" >
<image width="10%" height="40%" filename="Textures/fuji_season.tga" imageMode="subImage:0,0,250,150" >
<interact onClick="onPopUpClick(0)"/>
</image>
</panel>
</panel>
</popup>
</nifty>
[/java]
Sadly ‘something’ shows up, but it has not to do woth what I defined in .xml, nor changes when I changes my xml.
So I guess its not enough to nifty.createPopup(“niftyPopup”) to get the right template, it looks more, like it creates a default one new.
Is there a simple example of popups, sadly even on NiftyGuiDemo I did not find one (and besides NiftyGuiDemo crashes soon after the first start animation.
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main] java.lang.NoSuchMethodError: de.lessvoid.nifty.controls.TextField.setText(Ljava/lang/String;)V at de.lessvoid.nifty.examples.controls.listbox.ListBoxDialogController.bind(ListBoxDialogController.java:65) ...