Archive for docs

Here is your (very late but epic!) christmas present …

// December 29th, 2011 // 5 Comments » // docs, release

Nifty documentation is currently scattered around the internet.

You can find some pieces in the Nifty wiki, on the blog that you’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’d really like to do was to consolidate all of Niftys documentation into one single information hub. And so we did … and we’re now proud to present to you:

Nifty GUI 1.3.1 – The Missing Manual

Nifty GUI 1.3.1 - The Missing Manual

The PDF is an epic 110 pages book hosted at sf.net 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.

I hope you had a great christmas 2011 and that you’ll enjoy reading the manual! :D

void

PS: In other news Nifty 1.3.1 has been released! Get it at sf.net while it’s hot! I’ll write a proper blog post about 1.3.1 as soon as I’ve got the complete changelog together ;)

ListBox Overhaul, new and improved API available and some more

// December 13th, 2010 // 4 Comments » // demo, design, docs

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 code of this project is available online. You can check out the source directly from SVN using https://nifty-gui.svn.sourceforge.net/svnroot/nifty-gui/nifty-default-controls-examples/trunk or you can browse it online here: http://nifty-gui.svn.sourceforge.net/viewvc/nifty-gui/nifty-default-controls-examples/trunk/.

And if that is not enough … we’ve done the same new API treatment to the CheckBox and we plan to do the same to the remaining Nifty Standard Controls!

Reference in the Wiki

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):

http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Nifty_Standard_Controls_%28Nifty_1.3%29

And you can keep reading about all the little Nifty details we’ve changed and improved and especially why.

(more…)

Tired of Nifty XML? Try the new Nifty Builder Java classes! :D

// September 4th, 2010 // 11 Comments » // design, docs

In order to improve the usability of Nifty, Nifty user arielsan of gemserk has started creating a “Builder Pattern” 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 a Nifty ScreenBuilder class available as your starting point. Here is a quick example what you can do with it:

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);

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.

Please Note the double “{” and “}” characters. We’re creating anonymous inner classes with an initialize block to have a nice and readable form.
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.

Please Note:

As we’re creating annonymous inner classes each time we add a new xxxBuilder() {{ }} method and we’re nesting them it’s possible to access methods from the previous annonymous class and that could be confusing because we could misconfigure the parent element. So it’s probably best to only use methods from the current Builder class.

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: 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

Have fun,
void in cooperation with arielsan =)

Every thing you always wanted to know about the Nifty screen-Tag

// August 19th, 2010 // No Comments » // docs

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 has been updated and the <screen> Tag and all of its attributes have been explained and documented!

You can find the reference here: http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Elements

Have fun,
void :)

Nightly Builds Available

// May 14th, 2010 // No Comments » // bubble, docs

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 “mvn clean deploy” 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:

<repositories>
    <repository>
      <id>nifty-maven-repo.sourceforge.net</id>
      <url>http://nifty-gui.sourceforge.net/nifty-maven-repo</url>
    </repository>
</repositories>

will automatically get the latest nifty builds!

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.

Currently the following projects are build each night.

Nifty
http://nifty-gui.sourceforge.net/nifty-maven-repo/lessvoid/nifty/
http://nifty-gui.sourceforge.net/nifty-maven-repo/lessvoid/nifty-default-controls/
http://nifty-gui.sourceforge.net/nifty-maven-repo/lessvoid/nifty-style-black/

Nifty Renderer
http://nifty-gui.sourceforge.net/nifty-maven-repo/lessvoid/nifty-lwjgl-slick-renderer/
http://nifty-gui.sourceforge.net/nifty-maven-repo/lessvoid/nifty-lwjgl-renderer/
http://nifty-gui.sourceforge.net/nifty-maven-repo/lessvoid/nifty-slick-renderer/
http://nifty-gui.sourceforge.net/nifty-maven-repo/lessvoid/nifty-java2d-renderer/

The JME2 Renderer currently has some weird problems being automatically build. So this is not yet available – still working on it:
http://nifty-gui.sourceforge.net/nifty-maven-repo/lessvoid/nifty-jme-renderer/

If you’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’t mind the name of the jar tho. It’s automatically generated by Maven and it’s just named with the build date and time.

Good luck!
void

Nifty plays well with others and of course with slick2d too

// September 13th, 2009 // 5 Comments » // design, docs

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 switch from your in game state to the NiftyGameState and display the GUI.

But 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).

It’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 Nifty Forum at souceforge.net I did now :)

What’s demonstrated in the new slick example is, how you can use Nifty to render a GUI on top of a normal slick GameState.

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 :D

Slick Overlay with Nifty GUI

Slick Overlay with Nifty GUI

You can try it out with the Webstart:

http://nifty-gui.sourceforge.net/webstart/nifty-slick-overlay-demo.jnlp

and you can find the example in svn or you can browse it online here:

http://nifty-gui.svn.sourceforge.net/viewvc/nifty-gui/nifty-examples/trunk/src/main/java/de/lessvoid/nifty/examples/slick/niftyoverlay/ (Java classes)

http://nifty-gui.svn.sourceforge.net/viewvc/nifty-gui/nifty-examples/trunk/src/main/resources/slick/niftyoverlay/overlay.xml?revision=534&view=markup (Nifty XML for the Screen – overlay.xml)

Keep reading the full Article to see the details on how we get this to work and what you need to consider.

(more…)

Nifty Sourceforge.net Updates

// April 4th, 2009 // 1 Comment » // docs

We’ve added a new Wikipage that gives an Introduction to the Nifty Style System:

Effect Tutorial/Introduction

It’s not completly finished yet but should give you some more informations about effects in Nifty.

Additionally we’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:

Nifty Gallery at Sourceforge

Nifty Forum at Sourceforge

Have fun,
void =)

wiki updated

// March 14th, 2009 // No Comments » // docs

Adding Documentation on how and where to “svn checkout” Nifty and how to build it with Maven:

Building Nifty from Source Wiki Page

:D

Updated Slick and Lwjgl Library Versions + More Maven Love

// March 14th, 2009 // No Comments » // bubble, docs

I’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’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:

<repositories>
  <repository>
    <id>nifty-maven-repo.sourceforge.net</id>
    <url>http://nifty-gui.sourceforge.net/nifty-maven-repo</url>
  </repository>
</repositories>

to your applications pom.xml and it will automatically find the Nifty dependency :) So far so good.

BUT

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! :D

So what does this mean for you?

It means just one thing. It’s now easier then ever to build Nifty! Just “svn co” it from Sourceforge and execute “mvn package” and it should automatically download all required libs without any changes!

Nifty! :D

Effects Reference added to Wiki

// February 15th, 2009 // No Comments » // docs

A Nifty Effects Reference Page has been added to the Nifty Gui Wiki at sourceforge.net :) It’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