bio photo

So, now that I have your attention - it's not so bad as it sounds, really :)

Basically there have been two changes that might or might not influence your existing Nifty XML/Code base. The

So there is nothing to be worried about too much.

However there is one more important thing. If you've used Nifty XSD validation then the XSD Namespace has now been changed too. The new one is: "http://nifty-gui.sourceforge.net/nifty-1.3.xsd" instead of the old one "http://nifty-gui.sourceforge.net/nifty.xsd". So you'll need to download the new version and modify the nifty xml tag if you want to use XML editor support to write the new Nifty 1.3 XML.

The correct way to specifiy the XSD in XML-Files for Nifty 1.3 is now:

</pre>
Keep reading for a detail explanation of the two changes mentioned above.</p>

Label is now a Control</strong></p>

The Nifty core only knows about , and Elements which forms the base of all other elements that Nifty provides, including all of the Standard Controls that are build upon these Elements. So is basically a low level output of text which means you'll need to specify the font to be used, the text, the color and so on. The

If you want to change the Label/Text dynamically from Java you'll need to access the TextRenderer class of the Element and change the Text property on this class. This works but requires you to know the internals of Nifty and the Text-Elements. It would be much nicer if you could simply call setText() on the Label directly. And this was the main motivation for the current change.

So the Label is now a Standard Control which means you'll need to create it with "" instead of "

So for dynamic Labels that you'd like to use to show changing text informations you should now consider the Label control instead of the Element.</p>

New Standard Control API</strong></p>

Besides lots of bugfixes and improvements of the Nifty core, Nifty 1.3 will mostly concentrate on the Standard Controls. Buttons, Textfields, Listbox and so on will now be more powerful and easier to use from Java compared to previous Nifty versions (You should keep an eye on the Nifty 1.3 Standard Controls Reference in the Nifty wiki</a> for even more details which is constantly updated).</p>

Instead of accessing the Controller of the Control directly there is now a dedicated interface available for each of the Controls. This Interface is dedicated to the Java API the control provides to you. Once you've retrieved the new Interface you can use the control through the API which offer you more higher level access to the functionality of the Control. So for instance to get the Selection of a ListBox you can now simply call:

listBox.getSelection();</pre>
which will give you the Selection of the ListBox as a List of your Model Objects back (again, see the Reference in the Wiki for examples and more informations).</p>

Access to the the API is through a new method on the Screen. To get the Button API:

Button button = screen.findNiftyControl("appendButtonId", Button.class);</pre>
As the second parameter (in this case Button.class) the API Interface is required and the Nifty Id of the Element representing the control as the first parameter. The object you get back is the API Interface.</p>

That's all for now. Thanks for your patience waiting for Nifty 1.3! It will be worth it :D

void