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