New answers tagged

0

First off, the tutorial you linked is outdated. I also can't find any reference to Nifty in it. I'm using Nifty 1.4 and cannot reproduce your problem. I can set the text via TextRenderer from the label. However, you should avoid using renderers directly if you can achieve the same with a NiftyControl: Element loadingtext = ...


1

getRenderer is going to return null if the element does not contain the class you're trying to retrieve. In this case, the element doesn't contain a TextRenderer, so it returns null. You can avoid the error: Element element = nifty.getScreen("loadlevel").findElementByName("loadingtext"); if(element == null) return; TextRenderer textRenderer = ...


1

Try the following, tested in JMonkey SDK 3.0: <?xml version="1.0" encoding="UTF-8"?> <nifty xmlns="http://nifty-gui.sourceforge.net/nifty-1.3.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://nifty-gui.sourceforge.net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd"> <useStyles ...



Top 50 recent answers are included