Archive for bubble

Nifty User zozo64 creates Basis Drag and Drop Demo!

// June 28th, 2010 // 1 Comment » // bubble, demo, design

See! This is what I’ve meant! :)

Nifty gives you an easy to use framework that you can extend with your own ideas. Just like Nifty user zozo64 did. Nifty is missing drag and drop support? No problem! He created his own! :D

To be honest, he found some bugs too :) but all of that improved Niftys core systems. So that’s a good thing. We’ll probably bring his work as a standard drag and drop control into the standard controls project soon.

For the moment you can take a look at the code. It’s part of the nifty examples project:

http://nifty-gui.svn.sourceforge.net/viewvc/nifty-gui/nifty-examples/trunk/src/main/java/de/lessvoid/nifty/examples/dragndrop/

And here is a first preview of zozo64 work:

Nifty Basic Drag and Drop from void on Vimeo.

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

Dynamically Changing Button Text/Width and the Centerlayout

// February 21st, 2010 // 1 Comment » // bubble, design

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:

Read the complete blog post for details.
(more…)

New Feature – Keyframes for Nifty Effects

// October 27th, 2009 // No Comments » // bubble, design

Well, I’m currently rewriting the old Nifty Introduction Demonstration that somehow didn’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’m rewritting it now to update it to the current Nifty Standards.

In the process I just want a moving Nifty GUI Logo like this one

So the logo should resize while fading in and keep on resizing while fading out.

(more…)

So and what’s next?

// August 29th, 2009 // No Comments » // bubble

Well, Nifty 1.0 should be quite stable now. It’s probably not perfect yet but you already get a whole lot to play with already :)

So, what’s next with Nifty?

Write more Documentation:

  • Programmers Manual / Introduction to Nifty as a little PDF book is planned. Looking forward to this! :)
  • Reference Wiki for all the Effects and Element Attributes and so on

Make it more usable:

  • Allow another “language” to define the GUI in (besides XML). Maybe a DSL in groovy or scala or something else :)
  • Fix bugs and other issues
  • Improve the Layout Part and make this more easy and accessible

Make it more modular:

  • Nifty now depends on Slick for Sound and Image handling. Some people reported that they don’t want to be forced to be dependent on Slick. So to have Slick as an Option would be a plus (this is already prepared for but was too much work to finish for 1.0 :)
  • Make even better Slick integration xD
  • Split Nifty into even more modules so that you can only use the part you need (effects for instance could be another jar)

And that’s the current plan!

Have fun!

1.0 – RC 1

// March 29th, 2009 // No Comments » // bubble

I’ve just commited some final changes to the loader to svn.

Finally everything is in place again. Changing the loading code was a lot more work than expected. But adding a preprocessing step was the key to solve all the issues and get the code much cleaner.

As an additional benefit nifty now knows for every attribute from which style it came from. So removing a style and replacing it with another one on the fly is supported :)

We’re now testing the current version in svn with an actual game. When everything works ok the 1.0 release of nifty gui will be available soon – for real this time ;)

In the meantime you can follow nifty development at twitter

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

Improved support for dynamically created Controls

// March 9th, 2009 // No Comments » // bubble

Nifty was meant to read everything from XML files. But sometimes this is not enough because you need to decide from within your code what needs to be created.

This was possible in older versions of Nifty but was kinda tricky.

With Nifty 1.0 (currently available in svn) this has been improved. There are now special classes available to create and configure the build-in elements like Panel, Text, Label and Image.

Example use:

CreatePanel createPanel = new CreatePanel();
createPanel.setChildLayout("horizontal");
createPanel.setHeight("8px");
createPanel.create(nifty, screen, parent);

There is now even support to dynamically create your controls with a CreateCustomControl class.

Nifty stuff :)

Well …

// February 12th, 2009 // 1 Comment » // bubble

… actually I really want to release Nifty 1.0 at the end of 2008.

But as we added feature after feature, well, things got a bit unstable and pretty ugly (To be honest … fubar :) . So some parts of the controls broke, some demos broke and parts of nifty turned to crap.

I tried to fix it, but especially the loading code (loading xml and creating the runtime nifty object tree from it) got to messed up for any repair.

So we took a break from it.

But now we’re back! :)

I’ve started rewritting the loader code and everything looks shiny, new and great again. It’s not finished yet (control loading is still missing) but it’s looking much cleaner than the old stuff.

BTW: I’ve invented a small little side project while rewritting the loader. It’s kinda another XML Java Binding Project that is based around my own little XML-Schema Definition called “Lightweight XML Schema” (lwxs). The project still relies on XPP3 for xml parsing. You can basically describe what your xml file looks like (exactly like XSD but much simpler) and then you can easily read a matching XML file to some representation in java. It’s all very simple but made the loader pretty easy :)

And mind you, only the loader was broken! The Nifty core engine has not been changed and is still pretty solid :D

So hang on! Great things are about to happen!
void

PS: New Wiki Documentation Project for Nifty GUI started.
PPS: Nifty 1.0 – probably available this year! :o )

Nifty Slick Integration in Nifty Version 0.0.4

// August 3rd, 2008 // 8 Comments » // bubble

Slick 2D is a great library for game development. With the upcoming release of Nifty GUI 0.0.4 there will be an even easier way to integrate your Nifty GUI into your Slick application.

The current Nifty GUI Version 0.0.3 can already be used with Slick but it might become a little tricky to save/restore OpenGL state when switching between Slick and Nifty rendering. The basic approach would be to call niftys render() method after you’ve rendered all of your Slick graphics. This “manual” rendering is the usual way for Nifty integration and is shown in the Hello World example on the Nifty Project Website.

With the Release of Nifty Version 0.0.4 there will be a Slick GameState implementation available for easy of use. If you’re new to Slick GameStates there’s an article in the Slick wiki about the basic principles. With Nifty 0.0.4 you get a NiftyGameState class that extends the Slick BasicGameState. So you can simply use an instance of this new class (or a subclass) and voila you have the ability to add a Nifty GUI to your Slick app in no time :)

Example:

public void initStatesList(final GameContainer container) throws SlickException {
  NiftyGameState state = new NiftyGameState(MENU_ID);
  state.fromXml("mainmenu.xml", new ScreenController() {
    public void bind(Nifty nifty, Screen screen) {
    }
    public void onEndScreen() {
    }
    public void onStartScreen() {
    }
  });
  addState(state);
}

Nifty! :)