O'Reilly logo

jMonkeyEngine 3.0 Cookbook by Rickard Edén

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Initializing Nifty and managing an options menu

To start things off, let's begin with a simple recipe that will provide us with the basics of setting up the application to use Nifty GUI and tell us how to manage the options menu. An options menu is usually found in games; it acts as a link between different screens. For this reason, it's suitable to create it using the control pattern so it can be easily handled across screens.

We'll initialize Nifty GUI inside AppState to offset it from the main application code and then access the application from Nifty and control Nifty through code.

Getting ready

Let's look at how to initialize Nifty in an application. We start off by defining a new AppState to handle our Nifty functions. We can call it NiftyAppState ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required