I’m very new to jme3 and 3d engines in general. I’ve also never used NiftyGUI in the past.
That said, I have been through the Beginner’s Tutorials and several of the intermediate ones here:
https://jmonkeyengine.github.io/wiki/jme3.html#installing_jmonkeyengine_3
To advance my project further, I wanted to look at a small, simple, functional game program to see the pieces fit together. To that end, I found a repo for the MonkeyZone game, downloaded it, upgraded it to 3.1 and fixed all the errors.
Except for one error.
This error exists in 12 places in the project, across 3 class files.
Wherever the method screen.findElementByName(String name) is called, the first instance of that is crossed out, as though deprecated, with the following instance throwing an error.
Here are three examples:
Element panel = screen.findElementByName("layer").findElementByName("panel").findElementByName("players_panel").findElementByName("players_list").findElementByName("panel");
hitPoints = screen.findElementByName("layer").findElementByName("panel_bottom").findElementByName("bottom_panel_left").findElementByName("status_text_01").getRenderer(TextRenderer.class);
statusText = nifty.getScreen("load_game").findElementByName("layer").findElementByName("panel").findElementByName("status_text").getRenderer(TextRenderer.class);
The error thrown is “cannot find symbol.” As below:
C:\Users\Christopher\MyJMonkey\trunk\src\com\jme3\monkeyzone\ClientMain.java:190: error: cannot find symbol
statusText = nifty.getScreen("load_game").findElementByName("layer").findElementByName("panel").findElementByName("status_text").getRenderer(TextRenderer.class);
symbol: method findElementByName(String)
location: class Element
Hovering over the problem returns the following:
Dereferencing possible null pointer
Any help would be thoroughly appreciated. Please let me know if there is anything else I can add to help clarify the situation!
P.S. – Additionally, although not throwing a warning, one library is also crossed out as though deprecated:
import de.lessvoid.nifty.controls.textfield.TextFieldControl;
I am unsure if this is related.