Gotoscreen doesn't work

I try to change from the main menu to an empty screen.

So I tried using gotoScreen(“end”);

but after that I print:

System.out.println(nifty.getCurrentScreen().getScreenId());

And it writes: start

Which is the name of the main menu. If this actually worked the result would be that it printed end.

But it doesn,t and I have no clue why!

It’s incredibly frustrating and I’m already pushed to have math exam tomorrow so Im extremly pressured.

WHY am I working on this now then? Because I am stupid.



Anyhow, after the start screen is closed in the xml, I do a simple empty screen like this:

[xml]</screen> <–Close the start screen.

<screen id=“end” controller=“start.MainClass” />[/xml]

Am I missing some thing or WHY is not the franme showing up?!=!?!?!?

Are u mapping a single ScreenController for 2 screens?

1 Like

Before I didn’t even have controller= in the end screen as It doesn’t need one.

But yes, for now they are the same. Thats a problem?

I think yes, try to create another controller.

1 Like

oh, no, I read that you can “reuse” the controllers, then maybe that is not the problem.

1 Like

Didn’t work -.-

Anyway, did u already see the TestNiftyGui.java ? That does the same thing.

1 Like

I have EXACLY like that!

I meen COMEON!

Do I have to update jme3 again?!

Everytime I download a new version the whole shithole breaks down! Hate downloading new version because every way of doing ANYTHING always change!

btw I’m not getting to update my jmp, when it reaches 23% it fails.

1 Like

I use nightly builds

what happens if you run the TestNiftyGui.java?

1 Like

Error because the xml doesnt exsist. Not even with absolute path to the webbsite

Lol. just add the jme3-test-data to the classpath.

1 Like

Btw here’s it:



[xml]<?xml version=“1.0” encoding=“UTF-8”?>

<nifty>

<screen id=“start” controller=“jme3test.niftygui.TestNiftyGui”>

<layer id=“layer” backgroundColor="#0000" childLayout=“center”>

<panel id=“panel” height=“25%” width=“35%” align=“center” valign=“center” backgroundColor="#f60f" childLayout=“center” visibleToMouse=“true”>

<interact onClick=“quit()”/>

<effect>

<onStartScreen name=“move” mode=“in” direction=“top” length=“300” startDelay=“0” inherit=“true”/>

<onEndScreen name=“move” mode=“out” direction=“bottom” length=“300” startDelay=“0” inherit=“true”/>

<onHover name=“pulsate” scaleFactor=“0.008” startColor="#f600" endColor="#ffff" post=“true”/>

</effect>

<text id=“text” font=“aurulent-sans-16.fnt” color="#000f" text=“Hello from jME3” align=“center” valign=“center” />

</panel>

</layer>

</screen>

<screen id=“end”>

</screen>

</nifty>[/xml]

1 Like

I’v done that, otherwise I wouldnt be able to compile this right? Or is it another folder your thinking of?

It’s already pre-compiled, just download the jme3-test-data libraly.

1 Like

Searched the wiki, no such thing “jme3-test-data” exsists.

I’m so *!

Hate these * examples! It takes more sweat and time to get the * examples to work than it takes to

actually solve the problem itself.

  • to this shit. I * give up.

    Thanks anyway, Appriciate it tho im furious.

    (I cencored it.)

Ok. Put this xml file in the folder where’s it is called by the TestNiftyGui.java and you are done.



[xml]<?xml version=“1.0” encoding=“UTF-8”?>

<nifty>

<screen id=“start” controller=“jme3test.niftygui.TestNiftyGui”>

<layer id=“layer” backgroundColor="#0000" childLayout=“center”>

<panel id=“panel” height=“25%” width=“35%” align=“center” valign=“center” backgroundColor="#f60f" childLayout=“center” visibleToMouse=“true”>

<interact onClick=“quit()”/>

<effect>

<onStartScreen name=“move” mode=“in” direction=“top” length=“300” startDelay=“0” inherit=“true”/>

<onEndScreen name=“move” mode=“out” direction=“bottom” length=“300” startDelay=“0” inherit=“true”/>

<onHover name=“pulsate” scaleFactor=“0.008” startColor="#f600" endColor="#ffff" post=“true”/>

</effect>

<text id=“text” font=“aurulent-sans-16.fnt” color="#000f" text=“Hello from jME3” align=“center” valign=“center” />

</panel>

</layer>

</screen>

<screen id=“end”>

</screen>

</nifty>[/xml]

1 Like

and the monkey logo too.

1 Like

How do you run those examples then?

I found the folder with tons of java files, no * clue how to use them straight from there.

Unless I must coipy the file, new project + new class in a new package etc. Im not gonna put up with that shit no more.