I noticed the class TextFieldControl is deprecated, but I just can’t find where to replace it with :s
Somebody who knows?
I don’t know if this talks about it or not:
Mentions a bunch of similar things, though.
hmm no that ain’t it, I think :s
The changes just happend, like 2 or 3 days ago.
username = textUsername.getControl(
that’s what I’m getting
We updated to the newest version only recently, those functions were considered “deprecated” before but were not really marked with the annotation, thats why you didn’t see it before.
You can still continue using this method, it just might get removed in a future release.
TextField username = screen.findNiftyControl("controlid", TextField.class);
with Nifty 1.3
I’ve added a comment to the @deprecated classes which your IDE should display and point you to the class/interface you should use instead. This should be available in one of the nightly jme3 builds too.
Actually it’s easy: only use classes/interfaces from the “de.lessvoid.nifty.controls” package and not from any of its sub packages anymore. This is done so that we can more freely change the implementation of controls without changing any of the nice new interfaces for the controls.
I don’t know why, but this didn’t work:
I got this error:
method findControl in class de.lessvoid.nifty.screen.Screen cannot be applied to given types;
reason: inferred type does not conform to declared bound(s)
So, I checked inheritances and stuff and tried this:
And it worked perfectly! so, on a short version:
However (despite I’m happy of being able to solve this), it wasn’t the way @void256 suggested so I guess there’s something wrong anyway (and I updated everything just in case).