Edmund
February 4, 2021, 1:58pm
1
Hello, I use nifty. When i create a textfield like this
control(new TextFieldBuilder(“name”,“text”){{
}});
i can change the text later with this
TextField textfield = screen.findNiftyControl(“name”, TextField.class);
textfield.setText(value);
but when i want to do the same with a text created with a Textbuilder, i don’t know how to change the text ???
text(new TextBuilder(“name”) {{
text(“xxx”);
}});
What do i have to do ro change the text later in the program?
Is it possible at all or should i use deactivated buttons instead?
1 Like
found in wiki:
Element niftyElement = nifty.getCurrentScreen().findElementByName(“score”);
// swap old with new text
niftyElement.getRenderer(TextRenderer.class).setText(“124”);
in: Interacting with the GUI from Java :: jMonkeyEngine Docs
will this help?
BTW: Most JME developers seems to use Lemur currently
2 Likes
Edmund
February 4, 2021, 2:11pm
3
Thank you for the fast answer.
btw. I’m glad that i know now how to handle nifty and there are allready thousands of lines of code in my program. So I don’t want to change everything again.
2 Likes