<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>nifty-gui &#187; docs</title>
	<atom:link href="http://nifty-gui.lessvoid.com/archives/category/documentation-tutorials-how-to/feed" rel="self" type="application/rss+xml" />
	<link>http://nifty-gui.lessvoid.com</link>
	<description>a nifty gui for your java opengl/lwjgl application</description>
	<lastBuildDate>Sun, 15 Jan 2012 17:54:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Here is your (very late but epic!) christmas present &#8230;</title>
		<link>http://nifty-gui.lessvoid.com/archives/378</link>
		<comments>http://nifty-gui.lessvoid.com/archives/378#comments</comments>
		<pubDate>Thu, 29 Dec 2011 01:30:01 +0000</pubDate>
		<dc:creator>void</dc:creator>
				<category><![CDATA[docs]]></category>
		<category><![CDATA[release]]></category>

		<guid isPermaLink="false">http://nifty-gui.lessvoid.com/?p=378</guid>
		<description><![CDATA[Nifty documentation is currently scattered around the internet. You can find some pieces in the Nifty wiki, on the blog that you&#8217;re reading right now, in forums like the Nifty Forum at sf.net or the jMonkeyEngine GUI Forum. Basically you have some bits of knowledge here and others somewhere else. Therefore something we&#8217;d really like [...]]]></description>
			<content:encoded><![CDATA[<p>Nifty documentation is currently scattered around the internet.</p>
<p>You can find some pieces in the <a href="http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Main_Page">Nifty wiki</a>, on the blog that you&#8217;re reading right now, in forums like the <a href="http://sourceforge.net/projects/nifty-gui/forums/forum/807893">Nifty Forum</a> at sf.net or the <a href="http://jmonkeyengine.org/groups/gui/forum/">jMonkeyEngine GUI</a> Forum. Basically you have some bits of knowledge here and others somewhere else.</p>
<p>Therefore something we&#8217;d really like to do was to consolidate all of Niftys documentation into one single information hub. And so we did &#8230; and we&#8217;re now proud to present to you:</p>
<p><strong>Nifty GUI 1.3.1 &#8211; The Missing Manual</strong></p>
<div id="attachment_383" class="wp-caption aligncenter" style="width: 310px"><a href="http://sourceforge.net/projects/nifty-gui/files/nifty-gui/nifty-gui-the-manual-v1.0.pdf/download"><img src="http://nifty-gui.lessvoid.com/wp-content/2011/12/nifty-book-cover-300x211.jpg" alt="" title="Nifty GUI 1.3.1 - The Missing Manual" width="300" height="211" class="size-medium wp-image-383" /></a><p class="wp-caption-text">Nifty GUI 1.3.1 - The Missing Manual</p></div>
<p>The PDF is an epic 110 pages book <a href="http://sourceforge.net/projects/nifty-gui/files/nifty-gui/nifty-gui-the-manual-v1.0.pdf/download">hosted at sf.net</a> that explains (almost) everything that you ever wanted to know about Nifty! The book will act as both a tutorial/introduction to Nifty as well as an in depth reference of the more complicated matters. The PDF contains lots of code examples, screenshots and illustrations.</p>
<p>I hope you had a great christmas 2011 and that you&#8217;ll enjoy reading the manual! <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>void</p>
<p>PS: In other news Nifty 1.3.1 has been released! <a href="http://sourceforge.net/projects/nifty-gui/files/nifty-gui/1.3.1/">Get it at sf.net</a> while it&#8217;s hot! I&#8217;ll write a proper blog post about 1.3.1 as soon as I&#8217;ve got the complete changelog together <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://nifty-gui.lessvoid.com/archives/378/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>ListBox Overhaul, new and improved API available and some more</title>
		<link>http://nifty-gui.lessvoid.com/archives/233</link>
		<comments>http://nifty-gui.lessvoid.com/archives/233#comments</comments>
		<pubDate>Sun, 12 Dec 2010 23:10:32 +0000</pubDate>
		<dc:creator>void</dc:creator>
				<category><![CDATA[demo]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[docs]]></category>
		<category><![CDATA[checkbox]]></category>
		<category><![CDATA[event bus]]></category>
		<category><![CDATA[eventbus]]></category>
		<category><![CDATA[listbox]]></category>
		<category><![CDATA[listener]]></category>
		<category><![CDATA[new api]]></category>
		<category><![CDATA[nifty]]></category>

		<guid isPermaLink="false">http://nifty-gui.lessvoid.com/?p=233</guid>
		<description><![CDATA[The ListBox has been greatly improved and got itself a new Nifty Java API. You can find an example right here (click the image for a webstart demo) or keep reading for all the details below. Example You can check the first example of the new ListBox online with the following Webstart URL: The source [...]]]></description>
			<content:encoded><![CDATA[<p>The ListBox has been greatly improved and got itself a new Nifty Java API. You can find an example right here (click the image for a webstart demo) or keep reading for all the details below.</p>
<p><strong>Example</strong></p>
<p>You can check the first example of the new ListBox online with the following Webstart URL:</p>
<p><a href="http://nifty-gui.sourceforge.net/webstart/nifty-default-controls-examples-1.0.jnlp"><img title="Bildschirmfoto 2010-12-12 um 23.40.53" src="../wp-content/2010/12/Bildschirmfoto-2010-12-12-um-23.40.53-300x225.png" alt="" width="300" height="225" /></a></p>
<p>The source code of this project is available online. You can check out the source directly from SVN using <a href="https://nifty-gui.svn.sourceforge.net/svnroot/nifty-gui/nifty-default-controls-examples/trunk">https://nifty-gui.svn.sourceforge.net/svnroot/nifty-gui/nifty-default-controls-examples/trunk</a> or you can browse it online here: <a href="http://nifty-gui.svn.sourceforge.net/viewvc/nifty-gui/nifty-default-controls-examples/trunk/">http://nifty-gui.svn.sourceforge.net/viewvc/nifty-gui/nifty-default-controls-examples/trunk/</a>.</p>
<p>And if that is not enough &#8230; we&#8217;ve done the same new API treatment  to the CheckBox and we plan to do the same to the remaining Nifty  Standard Controls!</p>
<p><strong>Reference in the Wiki</strong></p>
<p>You can find a complete reference about the new standard controls in Nifty 1.3 already on the Wiki (for the ListBox and the CheckBox):</p>
<p><a href="http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Nifty_Standard_Controls_%28Nifty_1.3%29">http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Nifty_Standard_Controls_%28Nifty_1.3%29</a></p>
<p>And you can keep reading about all the little Nifty details we&#8217;ve changed and improved and especially why.</p>
<p><span id="more-233"></span></p>
<p>It all started with a <a href="http://sourceforge.net/tracker/?func=detail&amp;aid=2874356&amp;group_id=223898&amp;atid=1059825">feature request for Nifty 1.3</a> which seems easy to add at first. Removing all or single elements from a Nifty ListBox sounds like a reasonable feature to have available. So I&#8217;d try to add this &#8230; and failed miserable! <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  The closer I looked into it the more despaired I&#8217;ve become.</p>
<p>What a mess!</p>
<p>Something I&#8217;d really love to do with Nifty 2.0 is to add a nice and clean API to the standard Nifty controls. The current way of interacting with most of the Nifty controls is kinda awkward (at least) and I want to improve this. So, I thought, hey, why not try to define a new API for the ListBox as a preparation for this and see how everything works out. Well, it turns out that in the end I&#8217;ve pretty much rewrote the whole ListBox! =) And that the new one is way better than what you currently have available!</p>
<p>One of the shortcomings of the old ListBox was speed. Internally it directly added the Nifty element tree adding elements dynamically and then used a Scrollpanel to scroll around that (maybe) huge list of elements. So basically it always rendered all elements and used the clipping of the element to hide everything that was not currently seen. Not a great idea after all <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Another problem was the API and that&#8217;s a little difficult to interact with Niftys internal screen representation. Although it&#8217;s not impossible to dynamically add/remove elements from Nifty this might not be the ideal solution to the ListBox problem.</p>
<p>So what did we changed? Well, actually a lot! <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>The new ListBox:</strong></p>
<ul>
<li>Instead of relying upon the scroll panel we now only use Nifty elements for what you can see and simply replace the content of the elements when you scroll to a big list of items. So, when your ListBox only display 4 elements there really are only 4 Nifty elements allocated. Of course the ListBox allows many more Items to be added but in that case only the content of the 4 elements are replaced. You can now specify how many elements you want your display to show with the &#8220;displayItems&#8221; attribute.</li>
</ul>
<ul>
<li>Scrollbars are now optional and you can disable them completly with the &#8220;vertical&#8221; and &#8220;horizontal&#8221; attributes. Simply adding for instance vertical=&#8221;false&#8221; to the ListBox will hide the vertical Scrollbar.</li>
</ul>
<ul>
<li>The ListBox now supports single as well as multiple selections. This means you can now configure your ListBox to allow the selection of only a single item or that you want to select multipe items. If you don&#8217;t want to allow selection at all you can even disable the selection completly.</li>
</ul>
<ul>
<li> Instead of relying on storing Strings the new ListBox allows you to story your own Objects directly. So say you want your user to select different space ships by the name of the ship you could simply store your &#8220;Ship&#8221; instances directly in the ListBox. Nifty determines what text it should display for your instance by calling toString() of your objects. If this is not suitable for you, you can change this by setting a specifc <a href="http://nifty-gui.svn.sourceforge.net/viewvc/nifty-gui/nifty-default-controls/trunk/src/main/java/de/lessvoid/nifty/controls/ListBoxViewConverter.java?revision=1167&amp;view=markup">ListBoxViewConverter</a> for your class.</li>
</ul>
<ul>
<li>The new ListBox now features a pretty complete API <a href="http://nifty-gui.svn.sourceforge.net/viewvc/nifty-gui/nifty-default-controls/trunk/src/main/java/de/lessvoid/nifty/controls/ListBox.java?revision=1167&amp;view=markup">ListBox</a> that allows you to dynamically add, remove, select, clear items to the ListBox. This is now all available using generics..</li>
</ul>
<p><strong>EventBus Notification</strong></p>
<p>In the process of updating the ListBox we&#8217;ve noticed that we&#8217;re missing a nice way to allow the controls to notify other components of the system about things happening. If the selection of the ListBox is changed we&#8217;d like other parts to be notified about that event. Well, the first thing that comes to ones mind is of course the Listener/Observer pattern. But there are some problems with this approach, mostly the strong binding between the objects that communicate. There is a <a href="http://www.osgi.org/wiki/uploads/Links/whiteboard.pdf">great PDF available from the OSGI people</a> that discusses some of the problems of the Listener pattern.</p>
<p>Having previously worked with GWT 2.x and its event bus architecture we&#8217;d like to have someting similar for Nifty too. What we want is a loose coupling between Nifty (as the creator of events) and your application (as the receiver of the events). As it turns out a publish/subscribe mechanism allows us to do just that! Nifty publishes events to some &#8220;global&#8221; EventBus. And your application on the other hand subscribes to this EventBus for all the events that it needs to handle. What sounds not very different from the standard Listener pattern at first is in fact a great improvement! There is only a dependency to the EventBus and not between the objects that communicate! Which helps a lot to decouple the objects from one another. Nifty does not need to know who will receive the event in the end. It just creates the event and publishes it to the EventBus and everybody interessted in it will be notified.</p>
<p>As it turns out there is a neat little project available that implements that mechanism for us. It is called <a href="http://www.eventbus.org/">EventBus</a> and is available as Open Source under the Apache License, Version 2.0. It&#8217;s only 80KB in size, so it should not hurt the download/memory footprint of Nifty that much. Nifty is now using the EventBus project for ListBox and CheckBox notifications which worked very very well so far! You subscribe to the EventBus using the id of the element as a topic and you&#8217;ll receive all events that the control with the given id produces. In the case of the ListBox this means that you receive instances of the <a href="http://nifty-gui.svn.sourceforge.net/viewvc/nifty-gui/nifty-default-controls/trunk/src/main/java/de/lessvoid/nifty/controls/ListBoxSelectionChangedEvent.java?revision=1169&amp;view=markup">ListBoxSelectionChangedEvent</a>. This basically sends you the current selection of the ListBox everytime the selection has been changed <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Good Times,<br />
void</p>
<p>PS: And if you NOW don&#8217;t feel like christmas is already here then I can&#8217;t help you =)</p>
]]></content:encoded>
			<wfw:commentRss>http://nifty-gui.lessvoid.com/archives/233/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Tired of Nifty XML? Try the new Nifty Builder Java classes! :D</title>
		<link>http://nifty-gui.lessvoid.com/archives/179</link>
		<comments>http://nifty-gui.lessvoid.com/archives/179#comments</comments>
		<pubDate>Sat, 04 Sep 2010 21:24:56 +0000</pubDate>
		<dc:creator>void</dc:creator>
				<category><![CDATA[design]]></category>
		<category><![CDATA[docs]]></category>

		<guid isPermaLink="false">http://nifty-gui.lessvoid.com/?p=179</guid>
		<description><![CDATA[In order to improve the usability of Nifty, Nifty user arielsan of gemserk has started creating a &#8220;Builder Pattern&#8221; based way to create Nifty GUIs. These classes can be used from within java to create a Nifty GUI without the need for an external xml file. We have improved the solution together and there is [...]]]></description>
			<content:encoded><![CDATA[<div id="magicdomid2840">
<p>In order to improve the usability of Nifty, Nifty user arielsan of <a href="http://blog.gemserk.com/">gemserk</a> has started creating a &#8220;Builder Pattern&#8221; based way to create Nifty GUIs. These classes can be used from within java to create a Nifty GUI without the need for an external xml file.</p>
<p>We have improved the solution together and there is a Nifty ScreenBuilder class available as your starting point. Here is a quick example what you can do with it:</p>
</div>
<div>
<pre class="brush:java">Screen mainScreen = new ScreenBuilder("main") {{
  controller(new ScreenControllerExample());

  layer(new LayerBuilder("layer") {{
    backgroundColor("#003f");
    childLayoutCenter();

    panel(new PanelBuilder() {{
      id("panel");
      childLayoutCenter();
      height(percentage(25));
      width(percentage(80));
    }});
  }});
}}.build(nifty);
</pre>
</div>
<div>
<p>This  should really read very well. We create a new Nifty Screen, add a  ScreenController, a single Layer with a backgroundColor and a panel  which is centered in the middle of the layer.</p>
</div>
<div>Please Note the double &#8220;{&#8221; and &#8220;}&#8221; characters. We&#8217;re creating anonymous inner classes with an initialize block to have a nice and readable form.</div>
<div>You can use the Nifty Builder to create your GUI completly in Java and without the need for a Nifty XML file now. Another use would be to do rapid prototyping of your GUI directly within Java. And you even have support from your IDE like autocompletion and javadoc too.<br />
<strong><br />
Please Note:</strong></div>
<div>
<p>
As we&#8217;re creating annonymous inner classes each time we add a new xxxBuilder() {{ }} method and we&#8217;re nesting them it&#8217;s possible to access methods from the previous annonymous class and that could be confusing because we could misconfigure the parent element. So it&#8217;s probably best to only use methods from the current Builder class.
</p>
<p>
Ariel also wrote an example GUI using the Builder mechanism which is part of the Java2d Renderer tests but can be used with other renderer systems too of course. You can find it in svn or use this direkt link to the file: <a href="http://nifty-gui.svn.sourceforge.net/viewvc/nifty-gui/nifty-java2d-renderer/trunk/tests/src/main/java/de/lessvoid/nifty/java2d/tests/GameExampleApp.java?view=markup">http://nifty-gui.svn.sourceforge.net/viewvc/nifty-gui/nifty-java2d-renderer/trunk/tests/src/main/java/de/lessvoid/nifty/java2d/tests/GameExampleApp.java?view=markup</a>
</p>
</div>
<div>Have fun,</div>
<div>void in cooperation with arielsan =)</div>
]]></content:encoded>
			<wfw:commentRss>http://nifty-gui.lessvoid.com/archives/179/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Every thing you always wanted to know about the Nifty screen-Tag</title>
		<link>http://nifty-gui.lessvoid.com/archives/171</link>
		<comments>http://nifty-gui.lessvoid.com/archives/171#comments</comments>
		<pubDate>Thu, 19 Aug 2010 22:54:01 +0000</pubDate>
		<dc:creator>void</dc:creator>
				<category><![CDATA[docs]]></category>

		<guid isPermaLink="false">http://nifty-gui.lessvoid.com/?p=171</guid>
		<description><![CDATA[You want to use the ESC key to skip a Nifty screen? You need to handle a keyboard event for the whole screen and not just when a single element has the keyboard focus? Or do you need to change the default focus element for a Nifty screen? Look no further! The Nifty GUI Wiki [...]]]></description>
			<content:encoded><![CDATA[<p>You want to use the ESC key to skip a Nifty screen?<br />
You need to handle a keyboard event for the whole screen and not just when a single element has the keyboard focus?<br />
Or do you need to change the default focus element for a Nifty screen?</p>
<p>Look no further!</p>
<p>The Nifty GUI Wiki has been updated and the &lt;screen&gt; Tag and all of its attributes have been explained and documented!</p>
<p>You can find the reference here: <a title="Nifty Wiki Reference Elements" href="http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Elements" target="_self">http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Elements</a></p>
<p>Have fun,<br />
void <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://nifty-gui.lessvoid.com/archives/171/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nightly Builds Available</title>
		<link>http://nifty-gui.lessvoid.com/archives/142</link>
		<comments>http://nifty-gui.lessvoid.com/archives/142#comments</comments>
		<pubDate>Fri, 14 May 2010 20:13:16 +0000</pubDate>
		<dc:creator>void</dc:creator>
				<category><![CDATA[bubble]]></category>
		<category><![CDATA[docs]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[hudson]]></category>
		<category><![CDATA[nightly builds]]></category>

		<guid isPermaLink="false">http://nifty-gui.lessvoid.com/?p=142</guid>
		<description><![CDATA[Nifty will now build each midnight automatically. Well, at least when this computer here is running at this time which, erm, should be often Hudson will svn checkout all relevant nifty projects and will then &#8220;mvn clean deploy&#8221; them to the nifty maven repository at sf.net. This means that all projects that are already being [...]]]></description>
			<content:encoded><![CDATA[<p>Nifty will now build each midnight automatically. Well, at least when this computer here is running at this time which, erm, should be often <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://hudson-ci.org/">Hudson</a> will svn checkout all relevant nifty projects and will then &#8220;mvn clean deploy&#8221; them to the nifty maven repository at sf.net. This means that all projects that are already being build with maven and have this in their pom.xml:</p>
<pre class="brush:xml">&lt;repositories&gt;
    &lt;repository&gt;
      &lt;id&gt;nifty-maven-repo.sourceforge.net&lt;/id&gt;
      &lt;url&gt;http://nifty-gui.sourceforge.net/nifty-maven-repo&lt;/url&gt;
    &lt;/repository&gt;
&lt;/repositories&gt;</pre>
<p>will automatically get the latest nifty builds!</p>
<p>Currently this means 1.2-SNAPSHOT for Nifty as well as the Nifty Default Controls and the black Style projects and 1.0-SNAPSHOT for the new Nifty Renderer Projects.</p>
<p>Currently the following projects are build each night.</p>
<p><strong>Nifty</strong><br />
<a href="http://nifty-gui.sourceforge.net/nifty-maven-repo/lessvoid/nifty/">http://nifty-gui.sourceforge.net/nifty-maven-repo/lessvoid/nifty/</a><br />
<a href="http://nifty-gui.sourceforge.net/nifty-maven-repo/lessvoid/nifty-default-controls/">http://nifty-gui.sourceforge.net/nifty-maven-repo/lessvoid/nifty-default-controls/</a><br />
<a href="http://nifty-gui.sourceforge.net/nifty-maven-repo/lessvoid/nifty-style-black/">http://nifty-gui.sourceforge.net/nifty-maven-repo/lessvoid/nifty-style-black/</a></p>
<p><strong>Nifty Renderer</strong><br />
<a href="http://nifty-gui.sourceforge.net/nifty-maven-repo/lessvoid/nifty-lwjgl-slick-renderer/">http://nifty-gui.sourceforge.net/nifty-maven-repo/lessvoid/nifty-lwjgl-slick-renderer/</a><br />
<a href="http://nifty-gui.sourceforge.net/nifty-maven-repo/lessvoid/nifty-lwjgl-renderer/">http://nifty-gui.sourceforge.net/nifty-maven-repo/lessvoid/nifty-lwjgl-renderer/</a><br />
<a href="http://nifty-gui.sourceforge.net/nifty-maven-repo/lessvoid/nifty-slick-renderer/">http://nifty-gui.sourceforge.net/nifty-maven-repo/lessvoid/nifty-slick-renderer/</a><br />
<a href="http://nifty-gui.sourceforge.net/nifty-maven-repo/lessvoid/nifty-java2d-renderer/">http://nifty-gui.sourceforge.net/nifty-maven-repo/lessvoid/nifty-java2d-renderer/</a></p>
<p>The JME2 Renderer currently has some weird problems being automatically build. So this is not yet available &#8211; still working on it:<br />
<a href="http://nifty-gui.sourceforge.net/nifty-maven-repo/lessvoid/nifty-jme-renderer/">http://nifty-gui.sourceforge.net/nifty-maven-repo/lessvoid/nifty-jme-renderer/</a></p>
<p>If you&#8217;re not using Maven you should still be able to get the SNAPSHOT jars from the URLs mentioned above. Just find the sub directory 1.2-SNAPSHOT or 1.0-SNAPSHOT and get the latest JAR from there. Don&#8217;t mind the name of the jar tho. It&#8217;s automatically generated by Maven and it&#8217;s just named with the build date and time.</p>
<p>Good luck!<br />
void</p>
]]></content:encoded>
			<wfw:commentRss>http://nifty-gui.lessvoid.com/archives/142/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nifty plays well with others and of course with slick2d too</title>
		<link>http://nifty-gui.lessvoid.com/archives/91</link>
		<comments>http://nifty-gui.lessvoid.com/archives/91#comments</comments>
		<pubDate>Sun, 13 Sep 2009 13:20:29 +0000</pubDate>
		<dc:creator>void</dc:creator>
				<category><![CDATA[design]]></category>
		<category><![CDATA[docs]]></category>
		<category><![CDATA[compatibily]]></category>
		<category><![CDATA[gui]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[overlay]]></category>
		<category><![CDATA[Slick]]></category>
		<category><![CDATA[slick2d]]></category>

		<guid isPermaLink="false">http://nifty-gui.lessvoid.com/?p=91</guid>
		<description><![CDATA[Nifty can be used as a standalone GUI. So when your game enters its menu or option screens Nifty is all there is on the screen and all user input is handled by Nifty. When using Nifty together with Slick2d this is represented by the NiftyGameState class. Using this class your Slick2d StateBasedGame can easliy [...]]]></description>
			<content:encoded><![CDATA[<p>Nifty can be used as a standalone GUI. So when your game enters its menu or option screens Nifty is all there is on the screen and all user input is handled by Nifty.</p>
<p>When using Nifty together with Slick2d this is represented by the NiftyGameState class. Using this class your Slick2d StateBasedGame can easliy switch from your in game state to the NiftyGameState and display the GUI.</p>
<p><strong>But</strong> this is not the only way Nifty can be used. You can easily use Nifty to render your in-game GUI too! Nifty plays well with others (as long as they use OpenGL/lwjgl for rendering that is).</p>
<p>It&#8217;s not complicated at all and I wanted to write example code that demonstrates how easy it is for a long time. Motivated by a question at the <a title="Nifty Forum at sourceforge.net" href="http://sourceforge.net/projects/nifty-gui/forums/forum/807893">Nifty Forum at souceforge.net</a> I did now <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>What&#8217;s demonstrated in the new slick example is, how you can use Nifty to render a GUI on top of a normal slick GameState.</p>
<p>Here is a screenshot of the example which renderes Text from within Slick that changes color when you press the keys 1-3. On top of this it renders a Nifty GUI that responds to mouse events. Additionally if you press 1-3 the colored Nifty boxes start to shake <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<div id="attachment_92" class="wp-caption aligncenter" style="width: 310px"><a href="http://nifty-gui.lessvoid.com/wp-content/2009/09/bildschirmfoto-2009-09-13-um-145515.png"><img class="size-medium wp-image-92" title="Slick Overlay with Nifty GUI" src="http://nifty-gui.lessvoid.com/wp-content/2009/09/bildschirmfoto-2009-09-13-um-145515-300x225.png" alt="Slick Overlay with Nifty GUI" width="300" height="225" /></a><p class="wp-caption-text">Slick Overlay with Nifty GUI</p></div>
<p>You can try it out with the Webstart:</p>
<p><a href="http://nifty-gui.sourceforge.net/webstart/nifty-slick-overlay-demo.jnlp">http://nifty-gui.sourceforge.net/webstart/nifty-slick-overlay-demo.jnlp</a></p>
<p>and you can find the example in svn or you can browse it online here:</p>
<p><a href="http://nifty-gui.svn.sourceforge.net/viewvc/nifty-gui/nifty-examples/trunk/src/main/java/de/lessvoid/nifty/examples/slick/niftyoverlay/">http://nifty-gui.svn.sourceforge.net/viewvc/nifty-gui/nifty-examples/trunk/src/main/java/de/lessvoid/nifty/examples/slick/niftyoverlay/</a> (Java classes)</p>
<p><a href="http://nifty-gui.svn.sourceforge.net/viewvc/nifty-gui/nifty-examples/trunk/src/main/resources/slick/niftyoverlay/overlay.xml?revision=534&amp;view=markup">http://nifty-gui.svn.sourceforge.net/viewvc/nifty-gui/nifty-examples/trunk/src/main/resources/slick/niftyoverlay/overlay.xml?revision=534&amp;view=markup</a> (Nifty XML for the Screen &#8211; overlay.xml)</p>
<p>Keep reading the full Article to see the details on how we get this to work and what you need to consider.</p>
<p><span id="more-91"></span></p>
<p>The way it works is pretty easy and it even works with anything you&#8217;ve rendered in lwjgl. Slick is not required but as shown it works very well with Slick too.</p>
<p>So you just need to:</p>
<ol>
<li> <strong>Save your current OpenGL-State and enable 2d Mode</strong><br />
You have to make sure you save your current OpenGL state and make sure you are in 2d &#8220;mode&#8221; before calling Nifty. Which means that everything is setup for 2d OpenGL rendering (orthogonal projection, modelview matrix aligned with the screen, etc. In Slick this is all handled by a single call to SlickCallable.enterSafeBlock(). This makes sure that the current Slick state is saved and changes in Slick or Nifty don&#8217;t disturb each other (we&#8217;re already in 2d mode too because of slick).</li>
<li><strong>Call Nifty to render its GUI</strong><br />
You call Nifty.render() to render the Nifty GUI. You can call render() with a boolean parameter that tells Nifty to clear the screen (parameter = true) or if it should not clear the screen at all (parameter = false). If you are rendering an overlay you probably want to leave the screen as is and render your GUI on top. So in this case simply call nifty.render(false).</li>
<li><strong>Restore your State and continue your own Rendering</strong><br />
When nifty.render() returns you can reset your state so that you can continue rendering 3d triangles or whatever you want to render on top (!) of Nifty GUI. Again in Slick this is a single SlickCallable.leaveSafeBlock() call.</li>
<li><strong>Forward KeyEvents</strong><br />
You decide if keyEvents get past through to Nifty by calling nifty.keyEvent() with the events you want that Nifty gets. If you don&#8217;t call keyEvent() no key events will get to Nifty what might or might not be what you want.</li>
<li><strong>Forward MouseEvents</strong><br />
Handling mouse events are a bit trickier because they are handled through the InputSystem interface which you need to call the Nifty constructor with. But creating an implementation of the InputSystem is easy because at the moment it only consists of one method that Nifty uses to request a List of current available MouseEvents. So you&#8217;re implementation can decide when and what mouse events get through to Nifty in the InputSystem-Implementation.</li>
</ol>
<p>The example in nifty-examples svn demonstrates how to forward MouseEvents but does not care about keyboard Events.</p>
<p>And that&#8217;s it! Nifty GUI playing together with others! Nifty! <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>void</p>
]]></content:encoded>
			<wfw:commentRss>http://nifty-gui.lessvoid.com/archives/91/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Nifty Sourceforge.net Updates</title>
		<link>http://nifty-gui.lessvoid.com/archives/85</link>
		<comments>http://nifty-gui.lessvoid.com/archives/85#comments</comments>
		<pubDate>Sat, 04 Apr 2009 14:19:00 +0000</pubDate>
		<dc:creator>void</dc:creator>
				<category><![CDATA[docs]]></category>

		<guid isPermaLink="false">http://nifty-gui.lessvoid.com/?p=85</guid>
		<description><![CDATA[We&#8217;ve added a new Wikipage that gives an Introduction to the Nifty Style System: Effect Tutorial/Introduction It&#8217;s not completly finished yet but should give you some more informations about effects in Nifty. Additionally we&#8217;ve removed the old Screenshots Page from the sf.net Nifty project website and enabled the much cooler gallery feature. And there is [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve added a new Wikipage that gives an Introduction to the Nifty Style System:</p>
<p><a href="http://apps.sourceforge.net/mediawiki/nifty-gui/index.php?title=Effect_Introduction">Effect Tutorial/Introduction</a></p>
<p>It&#8217;s not completly finished yet but should give you some more informations about effects in Nifty.</p>
<p>Additionally we&#8217;ve removed the old Screenshots Page from the sf.net Nifty project website and enabled the much cooler gallery feature. And there is now a sf.net standard forum enabled for the Nifty project too:</p>
<p><a href="http://apps.sourceforge.net/gallery/nifty-gui/"></a><a href="http://apps.sourceforge.net/gallery/nifty-gui/">Nifty Gallery at Sourceforge</a></p>
<p><a href="http://sourceforge.net/forum/?group_id=223898">Nifty Forum at Sourceforge</a></p>
<p>Have fun,<br />
void =)</p>
]]></content:encoded>
			<wfw:commentRss>http://nifty-gui.lessvoid.com/archives/85/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>wiki updated</title>
		<link>http://nifty-gui.lessvoid.com/archives/76</link>
		<comments>http://nifty-gui.lessvoid.com/archives/76#comments</comments>
		<pubDate>Sat, 14 Mar 2009 10:22:19 +0000</pubDate>
		<dc:creator>void</dc:creator>
				<category><![CDATA[docs]]></category>

		<guid isPermaLink="false">http://nifty-gui.lessvoid.com/?p=76</guid>
		<description><![CDATA[Adding Documentation on how and where to &#8220;svn checkout&#8221; Nifty and how to build it with Maven: Building Nifty from Source Wiki Page]]></description>
			<content:encoded><![CDATA[<p>Adding Documentation on how and where to &#8220;svn checkout&#8221; Nifty and how to build it with Maven:</p>
<p><a title="Nifty Wiki" href="http://apps.sourceforge.net/mediawiki/nifty-gui/index.php?title=Getting_Started#Building_Nifty_from_the_Source">Building Nifty from Source Wiki Page<br />
</a></p>
<p> <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://nifty-gui.lessvoid.com/archives/76/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updated Slick and Lwjgl Library Versions + More Maven Love</title>
		<link>http://nifty-gui.lessvoid.com/archives/74</link>
		<comments>http://nifty-gui.lessvoid.com/archives/74#comments</comments>
		<pubDate>Sat, 14 Mar 2009 10:11:12 +0000</pubDate>
		<dc:creator>void</dc:creator>
				<category><![CDATA[bubble]]></category>
		<category><![CDATA[docs]]></category>
		<category><![CDATA[lwjgl]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[maven repo]]></category>
		<category><![CDATA[maven repositoy]]></category>
		<category><![CDATA[Slick]]></category>

		<guid isPermaLink="false">http://nifty-gui.lessvoid.com/?p=74</guid>
		<description><![CDATA[I&#8217;ve now updated the Nifty Dependencies in SVN (for the Nifty 1.0 Release) to the following Versions: Slick #239 Lwjgl 2.0.1 Besides that I realized that I&#8217;ve already had setup a Nifty Maven Repository at Sourceforge. This was meant to store Nifty releases to allow other Projects that use Maven and Nifty to easily access [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve now updated the Nifty Dependencies in SVN (for the Nifty 1.0 Release) to the following Versions:</p>
<ul>
<li>Slick #239</li>
<li>Lwjgl 2.0.1</li>
</ul>
<p>Besides that I realized that I&#8217;ve already had setup a Nifty Maven Repository at Sourceforge. This was meant to store Nifty releases to allow other Projects that use Maven and Nifty to easily access the Nifty libs. So for instance you just need to add:</p>
<pre>&lt;repositories&gt;
  &lt;repository&gt;
    &lt;id&gt;nifty-maven-repo.sourceforge.net&lt;/id&gt;
    &lt;url&gt;http://nifty-gui.sourceforge.net/nifty-maven-repo&lt;/url&gt;
  &lt;/repository&gt;
&lt;/repositories&gt;</pre>
<p>to your applications pom.xml and it will automatically find the Nifty dependency <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  So far so good.</p>
<p>BUT</p>
<p>Today I realized that I could use the same approach to get Lwjgl and Slick2D easily under Maven control. So when switching the Versions to Slick #239 und Lwjgl 2.0.1 I deployed both libs to the Nifty Maven Repo at Sourceforge! <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>So what does this mean for you?</p>
<p>It means just one thing. It&#8217;s now easier then ever to build Nifty! Just &#8220;svn co&#8221; it from Sourceforge and execute &#8220;mvn package&#8221; and it should automatically download all required libs without any changes!</p>
<p>Nifty! <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://nifty-gui.lessvoid.com/archives/74/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Effects Reference added to Wiki</title>
		<link>http://nifty-gui.lessvoid.com/archives/57</link>
		<comments>http://nifty-gui.lessvoid.com/archives/57#comments</comments>
		<pubDate>Sun, 15 Feb 2009 14:04:23 +0000</pubDate>
		<dc:creator>void</dc:creator>
				<category><![CDATA[docs]]></category>
		<category><![CDATA[effects]]></category>
		<category><![CDATA[reference]]></category>
		<category><![CDATA[wiki]]></category>

		<guid isPermaLink="false">http://nifty-gui.lessvoid.com/?p=57</guid>
		<description><![CDATA[A Nifty Effects Reference Page has been added to the Nifty Gui Wiki at sourceforge.net It&#8217;s still work in progress but it already lists all standard effects that are available and it documents all of the standard parameters that are available. void]]></description>
			<content:encoded><![CDATA[<p>A Nifty <a title="Effects Reference" href="http://apps.sourceforge.net/mediawiki/nifty-gui/index.php?title=Effects" target="_self">Effects Reference Page</a> has been added to the <a title="Nifty GUI Wiki" href="http://apps.sourceforge.net/mediawiki/nifty-gui/index.php?title=Main_Page" target="_self">Nifty Gui Wiki</a> at sourceforge.net <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  It&#8217;s still work in progress but it already lists all standard effects that are available and it documents all of the standard parameters that are available.</p>
<p>void</p>
]]></content:encoded>
			<wfw:commentRss>http://nifty-gui.lessvoid.com/archives/57/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

