<?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"
	>

<channel>
	<title>nifty-gui</title>
	<atom:link href="http://nifty-gui.lessvoid.com/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>
	<pubDate>Sun, 21 Feb 2010 17:03:55 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<item>
		<title>Dynamically Changing Button Text/Width and the Centerlayout</title>
		<link>http://nifty-gui.lessvoid.com/archives/122</link>
		<comments>http://nifty-gui.lessvoid.com/archives/122#comments</comments>
		<pubDate>Sun, 21 Feb 2010 17:03:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[bubble]]></category>

		<category><![CDATA[design]]></category>

		<category><![CDATA[button control text]]></category>

		<category><![CDATA[button text]]></category>

		<category><![CDATA[buttons]]></category>

		<category><![CDATA[changing text]]></category>

		<guid isPermaLink="false">http://nifty-gui.lessvoid.com/?p=122</guid>
		<description><![CDATA[Jattra tries to dynamically change button text from within Java and he needs a Button that automatically resizes according to the width of the changed text.
You can follow both threads at the Nifty Help Forum at sf.net:

Changing Button Text Thread

Resizing Buttons to Text Thread.
Read the complete blog post for details.

Dynamically changing text was easy and [...]]]></description>
			<content:encoded><![CDATA[<p>Jattra tries to dynamically change button text from within Java and he needs a Button that automatically resizes according to the width of the changed text.</p>
<p>You can follow both threads at the Nifty Help Forum at sf.net:</p>
<ul>
<a href="https://sourceforge.net/projects/nifty-gui/forums/forum/807893/topic/3546927">Changing Button Text Thread</a></ul>
<ul>
<a href="https://sourceforge.net/projects/nifty-gui/forums/forum/807893/topic/3558041">Resizing Buttons to Text Thread</a>.</ul>
<p>Read the complete blog post for details.<br />
<span id="more-122"></span></p>
<p>Dynamically changing text was easy and has been added to the ButtonControl. You can now simply change text with the following code from java:</p>

<div class="wp_syntax"><div class="code"><pre class="java5">screen.<span style="color: #006600;">findControl</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;backButton&quot;</span>, ButtonControl.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">setText</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;New Text&quot;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Automatically resizing Buttons was a bit more involving tho.</p>
<p>Nifty actually has build in support for resizing elements according to other elements. But before we can understand what that means we first need to know a bit about the internal workings of a Nifty Button Control.</p>
<p>A Nifty Button consists of a Panel element with childLayout=&#8221;center&#8221; and one child element which is a Label element that represents the actual button text. So far so good and the standard style set (nifty-style-black) simply adds a fixed width to the button.</p>
<p>So simply using the Button control:</p>

<div class="wp_syntax"><div class="code"><pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;control</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Hello World&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></pre></div></div>

<p>will give you a button with a style specific fixed width.</p>
<p>You can override this fixed width when you use the button control like that:</p>

<div class="wp_syntax"><div class="code"><pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;control</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;4532px&quot;</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Hello Large Button World&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></pre></div></div>

<p>This works pretty good if you don&#8217;t need to change the button label text. No matter what you do to a button with a fixed width it will always stay at this width (Unless you change the width constraint from code as one of Jattras code examples shows. And although this works it is a bit cumbersome but until now the only way to achieve resizing buttons).</p>
<p>So what should we do to fix this?</p>
<p>Well, actually there is not really much to do. If you ever used a childLayout=&#8221;vertical&#8221; on something without setting a width but every child in that special element had a fixed size you already have seen that Nifty actually resizes the parent element!</p>
<p>And this is basically default behaviour in Nifty: Whenever Nifty finds an element without a width (or height) constraint it looks at all the child elements and if they all have a fixed width (or height) it automatically resizes the parent element to the size of all child elements.</p>
<p>And this is just what we need here <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>As stated above the Button control uses childLayout=&#8221;center&#8221; and up until now the center layout did not support this kind of auto-resizing feature. But this has been added to svn a moment ago.</p>
<p>So whenever Nifty encounters an element with childLayout=&#8221;center&#8221; and the child element has a fixed width then it will resize the element to the child width. And this works for our button control too! And it works even when dynamically changing text from within Java <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Well, there is one thing to note tho. For backward compatibility the nifty-style-black still sets a fixed width to the button. So to enable the auto resizing you have to override the witdh of the button with an empty String.</p>
<p>Example to enable the auto resizing Button:</p>

<div class="wp_syntax"><div class="code"><pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;control</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;autoresizing button&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></pre></div></div>

<p>And that&#8217;s it. <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Note:</strong><br />
Another thing to note is, that the change to the center layout logic now requires you to set a width to all elements that use childLayout=&#8221;center&#8221;. Before this change there was no auto resizing done to elements that use center layout. To prevent the auto resizing that will be used on that elements now you need to specify a width to this elements.</p>
]]></content:encoded>
			<wfw:commentRss>http://nifty-gui.lessvoid.com/archives/122/feed</wfw:commentRss>
		</item>
		<item>
		<title>Nifty GUI sightings - 4our</title>
		<link>http://nifty-gui.lessvoid.com/archives/119</link>
		<comments>http://nifty-gui.lessvoid.com/archives/119#comments</comments>
		<pubDate>Mon, 15 Feb 2010 22:40:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[sightings]]></category>

		<guid isPermaLink="false">http://nifty-gui.lessvoid.com/?p=119</guid>
		<description><![CDATA[Another game with a nifty gui
good work jattra! 
]]></description>
			<content:encoded><![CDATA[<p><a href="https://sourceforge.net/apps/mediawiki/four-game/index.php?title=Main_Page">Another game with a nifty gui</a></p>
<div id="attachment_120" class="wp-caption alignnone" style="width: 310px"><a href="http://nifty-gui.lessvoid.com/wp-content/2010/02/bildschirmfoto-2010-02-15-um-233508.png"><img class="size-medium wp-image-120" title="4our game screenshot" src="http://nifty-gui.lessvoid.com/wp-content/2010/02/bildschirmfoto-2010-02-15-um-233508-300x225.png" alt="4our game screenshot" width="300" height="225" /></a><p class="wp-caption-text">4our game screenshot</p></div>
<p>good work jattra! <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/119/feed</wfw:commentRss>
		</item>
		<item>
		<title>New effect &#8220;gradient&#8221; Available</title>
		<link>http://nifty-gui.lessvoid.com/archives/116</link>
		<comments>http://nifty-gui.lessvoid.com/archives/116#comments</comments>
		<pubDate>Sun, 06 Dec 2009 18:19:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nifty-gui.lessvoid.com/?p=116</guid>
		<description><![CDATA[There is a new Effect available in SVN now. The &#8220;gradient&#8221; Effect allows you to draw vertical or horizontal gradients. You can use different colors and a percentage or pixel value for the position where the specific color should be.
Example:

&#60;onActive name=&#34;gradient&#34; direction=&#34;vertical&#34;&#62;
  &#60;value offset=&#34;0%&#34; color=&#34;#f00f&#34; /&#62;
  &#60;value offset=&#34;20%&#34; color=&#34;#0f0f&#34; /&#62;
  &#60;value offset=&#34;60%&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>There is a new Effect available in SVN now. The &#8220;gradient&#8221; Effect allows you to draw vertical or horizontal gradients. You can use different colors and a percentage or pixel value for the position where the specific color should be.</p>
<p>Example:</p>

<div class="wp_syntax"><div class="code"><pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;onActive</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;gradient&quot;</span> <span style="color: #000066;">direction</span>=<span style="color: #ff0000;">&quot;vertical&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;value</span> <span style="color: #000066;">offset</span>=<span style="color: #ff0000;">&quot;0%&quot;</span> <span style="color: #000066;">color</span>=<span style="color: #ff0000;">&quot;#f00f&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;value</span> <span style="color: #000066;">offset</span>=<span style="color: #ff0000;">&quot;20%&quot;</span> <span style="color: #000066;">color</span>=<span style="color: #ff0000;">&quot;#0f0f&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;value</span> <span style="color: #000066;">offset</span>=<span style="color: #ff0000;">&quot;60%&quot;</span> <span style="color: #000066;">color</span>=<span style="color: #ff0000;">&quot;#00ff&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;value</span> <span style="color: #000066;">offset</span>=<span style="color: #ff0000;">&quot;70%&quot;</span> <span style="color: #000066;">color</span>=<span style="color: #ff0000;">&quot;#ff0f&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;value</span> <span style="color: #000066;">offset</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">color</span>=<span style="color: #ff0000;">&quot;#ffff&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/onActive<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></div></div>

<p>Result:</p>
<p><a href="http://nifty-gui.lessvoid.com/wp-content/2009/12/gradient.png"><img class="alignnone size-medium wp-image-117" title="Gradient Example" src="http://nifty-gui.lessvoid.com/wp-content/2009/12/gradient.png" alt="" width="267" height="200" /></a></p>
<p>Awesome! <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>You can use different Alpha Values for the colors too to make a gradient overlay elements or you could change the blendMode to multiply before applying the gradient with the &#8220;blendMode&#8221; effect <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </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/116/feed</wfw:commentRss>
		</item>
		<item>
		<title>Nifty Snapshots are now available</title>
		<link>http://nifty-gui.lessvoid.com/archives/114</link>
		<comments>http://nifty-gui.lessvoid.com/archives/114#comments</comments>
		<pubDate>Sun, 06 Dec 2009 18:00:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nifty-gui.lessvoid.com/?p=114</guid>
		<description><![CDATA[To get access to the latest and greates Nifty, Snapshots (= Development Versions) are now available at the Nifty Maven Repository I&#8217;ve set up at sourceforge.net.
You can get the latest Snapshot here: http://nifty-gui.sourceforge.net/nifty-maven-repo/lessvoid/nifty/1.1-SNAPSHOT/
In case you&#8217;re using Maven you&#8217;ve probably already using this in your pom.xml:

&#60;repositories&#62;
  &#60;repository&#62;
    &#60;id&#62;nifty-maven-repo.sourceforge.net&#60;/id&#62;
    &#60;url&#62;http://nifty-gui.sourceforge.net/nifty-maven-repo&#60;/url&#62;
 [...]]]></description>
			<content:encoded><![CDATA[<p>To get access to the latest and greates Nifty, Snapshots (= Development Versions) are now available at the Nifty Maven Repository I&#8217;ve set up at sourceforge.net.</p>
<p>You can get the latest Snapshot here: <a href="http://nifty-gui.sourceforge.net/nifty-maven-repo/lessvoid/nifty/1.1-SNAPSHOT/">http://nifty-gui.sourceforge.net/nifty-maven-repo/lessvoid/nifty/1.1-SNAPSHOT/</a></p>
<p>In case you&#8217;re using Maven you&#8217;ve probably already using this in your pom.xml:</p>

<div class="wp_syntax"><div class="code"><pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;repositories<span style="font-weight: bold; color: black;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;repository<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;id<span style="font-weight: bold; color: black;">&gt;</span></span></span>nifty-maven-repo.sourceforge.net<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/id<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;url<span style="font-weight: bold; color: black;">&gt;</span></span></span>http://nifty-gui.sourceforge.net/nifty-maven-repo<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/url<span style="font-weight: bold; color: black;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/repository<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/repositories<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></div></div>

<p>You only need to change your nifty dependency to snapshot and you&#8217;re always using the latest Nifty Build:</p>

<div class="wp_syntax"><div class="code"><pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;dependency<span style="font-weight: bold; color: black;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;groupId<span style="font-weight: bold; color: black;">&gt;</span></span></span>lessvoid<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/groupId<span style="font-weight: bold; color: black;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;artifactId<span style="font-weight: bold; color: black;">&gt;</span></span></span>nifty<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/artifactId<span style="font-weight: bold; color: black;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;version<span style="font-weight: bold; color: black;">&gt;</span></span></span>1.1-SNAPSHOT<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/version<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/dependency<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></div></div>

<p>Good Luck and Have Fun!<br />
void</p>
]]></content:encoded>
			<wfw:commentRss>http://nifty-gui.lessvoid.com/archives/114/feed</wfw:commentRss>
		</item>
		<item>
		<title>Switching images with nifty effects in game</title>
		<link>http://nifty-gui.lessvoid.com/archives/112</link>
		<comments>http://nifty-gui.lessvoid.com/archives/112#comments</comments>
		<pubDate>Sun, 01 Nov 2009 17:04:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nifty-gui.lessvoid.com/?p=112</guid>
		<description><![CDATA[Someone over at the nifty forums asked how to switch images from java. You can find the thread and my answer here.
Well. So far so good but switching images can be a lot more exciting with nifty effects  
So let&#8217;s start with adding a new effect and attach it to the image with the [...]]]></description>
			<content:encoded><![CDATA[<p>Someone over at the nifty forums asked how to switch images from java. You can <a href="https://sourceforge.net/projects/nifty-gui/forums/forum/807893/topic/3445518">find the thread and my answer here.</a></p>
<p>Well. So far so good but switching images can be a lot more exciting with nifty effects <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So let&#8217;s start with adding a new effect and attach it to the image with the onCustom effect:</p>

<div class="wp_syntax"><div class="code"><pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;image</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;inventar&quot;</span> <span style="color: #000066;">filename</span>=<span style="color: #ff0000;">&quot;icon1.png&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;effect<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;onCustom</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;imageSize&quot;</span> <span style="color: #000066;">startSize</span>=<span style="color: #ff0000;">&quot;1.7&quot;</span> <span style="color: #000066;">endSize</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">&quot;150&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/effect<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/image<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></div></div>

<p>This adds an &#8220;imageSize&#8221; effect that starts with a imagesize of 1.7 times the original size and resizes the image back to the original size over the time of 150 ms. The &#8220;onCustom&#8221; effect means, that we can trigger this effect from java.</p>
<p>So when it comes time to change the image to the rocket launcher, the plasma gun or the BFG9000 <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> we can use the following java code to trigger the effect and change the image:</p>

<div class="wp_syntax"><div class="code"><pre class="java5">getElement<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;inventar&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">getRenderer</span><span style="color: #66cc66;">&#40;</span>ImageRenderer.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">setImage</span><span style="color: #66cc66;">&#40;</span>iconRocketLauncher<span style="color: #66cc66;">&#41;</span>
getElement<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;inventar&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">startEffect</span><span style="color: #66cc66;">&#40;</span>EffectEventId.<span style="color: #006600;">onCustom</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>The first line changes the image and the second line triggers the onCustom effect.</p>
<p>I&#8217;ve updated the slick overlay example with a little nifty image switching in the right upper border of the screen. You can change the different images with pressing the keys &#8220;a&#8221;, &#8220;b&#8221; and &#8220;c&#8221;.</p>
<p>You can find it here:</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 updated 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 - overlay.xml)</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/112/feed</wfw:commentRss>
		</item>
		<item>
		<title>New Feature - Keyframes for Nifty Effects</title>
		<link>http://nifty-gui.lessvoid.com/archives/108</link>
		<comments>http://nifty-gui.lessvoid.com/archives/108#comments</comments>
		<pubDate>Tue, 27 Oct 2009 01:05:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[bubble]]></category>

		<category><![CDATA[design]]></category>

		<category><![CDATA[demo]]></category>

		<category><![CDATA[effects]]></category>

		<category><![CDATA[interpolation]]></category>

		<category><![CDATA[introduction]]></category>

		<guid isPermaLink="false">http://nifty-gui.lessvoid.com/?p=108</guid>
		<description><![CDATA[Well, I&#8217;m currently rewriting the old Nifty Introduction Demonstration that somehow didn&#8217;t survive my last blog server switch  It was posted right here but the jnlp disappear. The demo explained some basic concepts of Nifty and it was written in Nifty  I&#8217;m rewritting it now to update it to the current Nifty Standards.
In [...]]]></description>
			<content:encoded><![CDATA[<p>Well, I&#8217;m currently rewriting the old Nifty Introduction Demonstration that somehow didn&#8217;t survive my last blog server switch <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> It was <a href="http://nifty-gui.lessvoid.com/archives/9">posted right here</a> but the jnlp disappear. The demo explained some basic concepts of Nifty and it was written in Nifty <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> I&#8217;m rewritting it now to update it to the current Nifty Standards.</p>
<p>In the process I just want a moving Nifty GUI Logo like this one</p>
<p><a href="http://nifty-gui.lessvoid.com/wp-content/2009/10/tutorial-intro.gif"><img class="alignnone size-medium wp-image-109" title="tutorial-intro" src="http://nifty-gui.lessvoid.com/wp-content/2009/10/tutorial-intro.gif" alt="" width="128" height="96" /></a></p>
<p>So the logo should resize while fading in and keep on resizing while fading out.</p>
<p><span id="more-108"></span><br />
My first try was this xml (only the resizing part is shown with the &#8220;imageSize&#8221; effect attached to &#8220;onStartScreen&#8221;):</p>

<div class="wp_syntax"><div class="code"><pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;onStartScreen</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;imageSize&quot;</span> <span style="color: #000066;">startSize</span>=<span style="color: #ff0000;">&quot;0.7&quot;</span> <span style="color: #000066;">endSize</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">time</span>=<span style="color: #ff0000;">&quot;600&quot;</span> <span style="color: #000066;">neverStopRendering</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;onStartScreen</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;imageSize&quot;</span> <span style="color: #000066;">startSize</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">endSize</span>=<span style="color: #ff0000;">&quot;1.3&quot;</span> <span style="color: #000066;">time</span>=<span style="color: #ff0000;">&quot;600&quot;</span> <span style="color: #000066;">neverStopRendering</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">startDelay</span>=<span style="color: #ff0000;">&quot;600&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></pre></div></div>

<p>Which was reasonable but doesn&#8217;t work. It doesn&#8217;t work because effects with a startDelay are in fact already active. In this case the second onStartScreen imageSize effect overwrites the first one with it&#8217;s intial startSize of 1.0 for the time the startDelay is active. Which, yeah, makes sense for most effects but sucks in this case.</p>
<p>What I&#8217;d really want to write is this instead:</p>

<div class="wp_syntax"><div class="code"><pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;onStartScreen</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;imageSize&quot;</span> <span style="color: #000066;">neverStopRendering</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;value</span> <span style="color: #000066;">time</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;0.7&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;value</span> <span style="color: #000066;">time</span>=<span style="color: #ff0000;">&quot;600&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;value</span> <span style="color: #000066;">time</span>=<span style="color: #ff0000;">&quot;1200&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;1.3&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/onStartScreen<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></div></div>

<p>Well, and now you can actually write it like this! <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>What this does is performing linear interpolation for of the given values. In the example above the value for the imageSize effect starts with 0.7 and changes to 1.0 over a time of 600ms. After that it continues to be interpolated from 1.0 to 1.3 for the next 600ms. When value tags are present they will overwrite the length parameter of the effect. So in the example the imageSize effect will last for 1200ms.</p>
<p>I&#8217;ve just commited this to svn. It is still work in progress and is therefore only available for the &#8220;imageSize&#8221; and the &#8220;fade&#8221; effect. I&#8217;m currently thinking about extending it to other effects where it is appropriate. I&#8217;m also considering to not only interpolate float values but to make it more general and the actual values are effect specific, so that you could interpolate color values for instance.</p>
<p>void</p>
]]></content:encoded>
			<wfw:commentRss>http://nifty-gui.lessvoid.com/archives/108/feed</wfw:commentRss>
		</item>
		<item>
		<title>Effect Reference with little animated gifs &#8230; soon</title>
		<link>http://nifty-gui.lessvoid.com/archives/103</link>
		<comments>http://nifty-gui.lessvoid.com/archives/103#comments</comments>
		<pubDate>Sat, 17 Oct 2009 20:48:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nifty-gui.lessvoid.com/?p=103</guid>
		<description><![CDATA[Ok, I was not able to add a effect reference each day but there was some progress, which is good.
Today I added &#8220;imageSize&#8221; and I&#8217;ve started to add little code snippets and animated gifs to the reference page too. So that the explanation makes more sense and you&#8217;ll get some code to start with.
I&#8217;ll continue [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, I was not able to add a effect reference each day but there was some progress, which is good.</p>
<p>Today I added &#8220;imageSize&#8221; and I&#8217;ve started to add little code snippets and animated gifs to the reference page too. So that the explanation makes more sense and you&#8217;ll get some code to start with.</p>
<p>I&#8217;ll continue to add effects documentation over the coming weeks <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>And here is the first with gif and code:</p>
<p><a href="http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Effects#imageSize">http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Effects#imageSize</a></p>
<p>Have fun,<br />
void</p>
]]></content:encoded>
			<wfw:commentRss>http://nifty-gui.lessvoid.com/archives/103/feed</wfw:commentRss>
		</item>
		<item>
		<title>Nifty GUI sightings - Shiring</title>
		<link>http://nifty-gui.lessvoid.com/archives/101</link>
		<comments>http://nifty-gui.lessvoid.com/archives/101#comments</comments>
		<pubDate>Tue, 06 Oct 2009 20:47:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[sightings]]></category>

		<guid isPermaLink="false">http://nifty-gui.lessvoid.com/?p=101</guid>
		<description><![CDATA[Shiring is a 2D MMORPG that uses Nifty GUI for it&#8217;s user interface. Check out it&#8217;s blog
http://blog.shiring.de
and especially the current GUI demo:

This is pretty awesome 
]]></description>
			<content:encoded><![CDATA[<p>Shiring is a 2D MMORPG that uses Nifty GUI for it&#8217;s user interface. Check out it&#8217;s blog</p>
<p><a href="http://blog.shiring.de">http://blog.shiring.de</a></p>
<p>and especially the current GUI demo:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://www.youtube.com/v/qzdONJ_rEzY&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;feature=player_embedded&amp;fs=1" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/qzdONJ_rEzY&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;feature=player_embedded&amp;fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>This is pretty awesome <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/101/feed</wfw:commentRss>
		</item>
		<item>
		<title>To document one nifty effect each day project started =)</title>
		<link>http://nifty-gui.lessvoid.com/archives/98</link>
		<comments>http://nifty-gui.lessvoid.com/archives/98#comments</comments>
		<pubDate>Sat, 03 Oct 2009 16:07:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nifty-gui.lessvoid.com/?p=98</guid>
		<description><![CDATA[I started to document the different nifty effects in the nifty wiki:
http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Effects
I&#8217;ll try to continue with documenting at least one effect each day 
]]></description>
			<content:encoded><![CDATA[<p>I started to document the different nifty effects in the nifty wiki:</p>
<p><a href="http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Effects">http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Effects</a></p>
<p>I&#8217;ll try to continue with documenting at least one effect each day <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/98/feed</wfw:commentRss>
		</item>
		<item>
		<title>Another shorter solution to the Nifty Overlay</title>
		<link>http://nifty-gui.lessvoid.com/archives/96</link>
		<comments>http://nifty-gui.lessvoid.com/archives/96#comments</comments>
		<pubDate>Sun, 13 Sep 2009 21:33:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nifty-gui.lessvoid.com/?p=96</guid>
		<description><![CDATA[Nifty and Slick User Tobse pointed out that you can use the NiftyGameState to create overlays too.
I like his version because it is shorter and much of the details of how the integration with Nifty works (calling render and forwarding input events to Nifty) are hidden from you. However the class NiftyGameState has been designed [...]]]></description>
			<content:encoded><![CDATA[<p>Nifty and Slick User Tobse pointed out that you can use the NiftyGameState to create overlays too.</p>
<p>I like his version because it is shorter and much of the details of how the integration with Nifty works (calling render and forwarding input events to Nifty) are hidden from you. However the class NiftyGameState has been designed as a base class for a real Nifty GUI State and was not really planned for overlay rendering.</p>
<p>So I think although both versions work there is still something missing (in both versions). I like the idea of hidding the details on one hand but I&#8217;m not sure if using the NiftyGameState is really the way to achieve this.</p>
<p>What do you think?</p>
<p>Click the &#8220;Read More&#8221; link to see the short version of TestState that Tobse wrote and which is less code than my initial version <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span id="more-96"></span></p>

<div class="wp_syntax"><div class="code"><pre class="java5"><span style="color: #000000; font-weight: bold;">package</span> tests;
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> org.<span style="color: #006600;">newdawn</span>.<span style="color: #006600;">slick</span>.<span style="color: #006600;">*</span>;
<span style="color: #000000; font-weight: bold;">import</span> org.<span style="color: #006600;">newdawn</span>.<span style="color: #006600;">slick</span>.<span style="color: #006600;">state</span>.<span style="color: #006600;">*</span>;
<span style="color: #000000; font-weight: bold;">import</span> de.<span style="color: #006600;">lessvoid</span>.<span style="color: #006600;">nifty</span>.<span style="color: #006600;">*</span>;
<span style="color: #000000; font-weight: bold;">import</span> de.<span style="color: #006600;">lessvoid</span>.<span style="color: #006600;">nifty</span>.<span style="color: #006600;">effects</span>.<span style="color: #006600;">EffectEventId</span>;
<span style="color: #000000; font-weight: bold;">import</span> de.<span style="color: #006600;">lessvoid</span>.<span style="color: #006600;">nifty</span>.<span style="color: #006600;">elements</span>.<span style="color: #aaaadd; font-weight: bold;">Element</span>;
<span style="color: #000000; font-weight: bold;">import</span> de.<span style="color: #006600;">lessvoid</span>.<span style="color: #006600;">nifty</span>.<span style="color: #006600;">screen</span>.<span style="color: #006600;">*</span>;
<span style="color: #000000; font-weight: bold;">import</span> de.<span style="color: #006600;">lessvoid</span>.<span style="color: #006600;">nifty</span>.<span style="color: #006600;">slick</span>.<span style="color: #006600;">NiftyGameState</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">/**
 * This is the original TestState1 from slick tests extended to a nifty gui overlay. This only
 * implements from ScreenController because we have a quit() onClick action definied in the
 * nifty xml file that is handled in here to quit the demo.
 *
 * @author void
 */</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> TestState2 <span style="color: #000000; font-weight: bold;">extends</span> BasicGameState <span style="color: #000000; font-weight: bold;">implements</span> ScreenController <span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #993333;">int</span> ID = <span style="color: #cc66cc;">1</span>;
	<span style="color: #000000; font-weight: bold;">private</span> GameContainer container;
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #aaaadd; font-weight: bold;">Font</span> font;
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #aaaadd; font-weight: bold;">Color</span> currentColor;
	<span style="color: #000000; font-weight: bold;">private</span> Nifty nifty;
	<span style="color: #000000; font-weight: bold;">private</span> NiftyGameState niftyGameState;
&nbsp;
	@<span style="color: #aaaadd; font-weight: bold;">Override</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">int</span> getID<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> ID;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> init<span style="color: #66cc66;">&#40;</span>GameContainer container, StateBasedGame game<span style="color: #66cc66;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> SlickException <span style="color: #66cc66;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">container</span> = container;
		font = <span style="color: #000000; font-weight: bold;">new</span> AngelCodeFont<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;menu.fnt&quot;</span>, <span style="color: #ff0000;">&quot;menu.png&quot;</span><span style="color: #66cc66;">&#41;</span>;
		currentColor = <span style="color: #aaaadd; font-weight: bold;">Color</span>.<span style="color: #006600;">white</span>;
		niftyGameState = <span style="color: #000000; font-weight: bold;">new</span> NiftyGameState<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>;
		niftyGameState.<span style="color: #006600;">fromXml</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;tests/overlay.xml&quot;</span>, <span style="color: #000000; font-weight: bold;">this</span><span style="color: #66cc66;">&#41;</span>;
		container.<span style="color: #006600;">getInput</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">addListener</span><span style="color: #66cc66;">&#40;</span>niftyGameState<span style="color: #66cc66;">&#41;</span>;
		niftyGameState.<span style="color: #006600;">init</span><span style="color: #66cc66;">&#40;</span>container, game<span style="color: #66cc66;">&#41;</span>;
		nifty = niftyGameState.<span style="color: #006600;">getNifty</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> render<span style="color: #66cc66;">&#40;</span>GameContainer container, StateBasedGame game, <span style="color: #aaaadd; font-weight: bold;">Graphics</span> g<span style="color: #66cc66;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> SlickException <span style="color: #66cc66;">&#123;</span>
		g.<span style="color: #006600;">setFont</span><span style="color: #66cc66;">&#40;</span>font<span style="color: #66cc66;">&#41;</span>;
		g.<span style="color: #006600;">setColor</span><span style="color: #66cc66;">&#40;</span>currentColor<span style="color: #66cc66;">&#41;</span>;
		g.<span style="color: #006600;">drawString</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;State Based Game Test&quot;</span>, <span style="color: #cc66cc;">100</span>, <span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>;
		g.<span style="color: #006600;">drawString</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;1-3 will switch between colors&quot;</span>, <span style="color: #cc66cc;">100</span>, <span style="color: #cc66cc;">300</span><span style="color: #66cc66;">&#41;</span>;
		g.<span style="color: #006600;">drawString</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;(this is all slick rendering!)&quot;</span>, <span style="color: #cc66cc;">100</span>, <span style="color: #cc66cc;">400</span><span style="color: #66cc66;">&#41;</span>;
		g.<span style="color: #006600;">drawString</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;and this is more slick text&quot;</span>, <span style="color: #cc66cc;">360</span>, <span style="color: #cc66cc;">650</span><span style="color: #66cc66;">&#41;</span>;
		g.<span style="color: #006600;">drawString</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;below (!) a nifty-gui overlay&quot;</span>, <span style="color: #cc66cc;">360</span>, <span style="color: #cc66cc;">700</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
		niftyGameState.<span style="color: #006600;">render</span><span style="color: #66cc66;">&#40;</span>container, game, g<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> update<span style="color: #66cc66;">&#40;</span>GameContainer container, StateBasedGame game, <span style="color: #993333;">int</span> delta<span style="color: #66cc66;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> SlickException <span style="color: #66cc66;">&#123;</span>
        <span style="color: #66cc66;">&#125;</span>
&nbsp;
	@<span style="color: #aaaadd; font-weight: bold;">Override</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> enter<span style="color: #66cc66;">&#40;</span>GameContainer container, StateBasedGame game<span style="color: #66cc66;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> SlickException <span style="color: #66cc66;">&#123;</span>
		niftyGameState.<span style="color: #006600;">enter</span><span style="color: #66cc66;">&#40;</span>container, game<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	@<span style="color: #aaaadd; font-weight: bold;">Override</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> keyReleased<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> key, <span style="color: #993333;">char</span> c<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>key == Input.<span style="color: #006600;">KEY_1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
			currentColor = <span style="color: #aaaadd; font-weight: bold;">Color</span>.<span style="color: #006600;">red</span>;
			getElement<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;red&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">startEffect</span><span style="color: #66cc66;">&#40;</span>EffectEventId.<span style="color: #006600;">onCustom</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>key == Input.<span style="color: #006600;">KEY_2</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
			currentColor = <span style="color: #aaaadd; font-weight: bold;">Color</span>.<span style="color: #006600;">green</span>;
			getElement<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;green&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">startEffect</span><span style="color: #66cc66;">&#40;</span>EffectEventId.<span style="color: #006600;">onCustom</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>key == Input.<span style="color: #006600;">KEY_3</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
			currentColor = <span style="color: #aaaadd; font-weight: bold;">Color</span>.<span style="color: #006600;">blue</span>;
			getElement<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;blue&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">startEffect</span><span style="color: #66cc66;">&#40;</span>EffectEventId.<span style="color: #006600;">onCustom</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #aaaadd; font-weight: bold;">Element</span> getElement<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">final</span> <span style="color: #aaaadd; font-weight: bold;">String</span> id<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> nifty.<span style="color: #006600;">getCurrentScreen</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">findElementByName</span><span style="color: #66cc66;">&#40;</span>id<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> bind<span style="color: #66cc66;">&#40;</span>Nifty nifty, Screen screen<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> onEndScreen<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> onStartScreen<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> quit<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		nifty.<span style="color: #006600;">getCurrentScreen</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">endScreen</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> EndNotify<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
			<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> perform<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
				container.<span style="color: #006600;">exit</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>void</p>
]]></content:encoded>
			<wfw:commentRss>http://nifty-gui.lessvoid.com/archives/96/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
