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

Customizing the input and settings page

Just about every modern game lets the player customize the input according to their own preferences. This recipe will rely on jMonkeyEngine to do the work for us, and we will use Nifty GUI as a visual aid. We'll use RawInputListener to work out which keys have been pressed and divide them between key codes and characters using the Keyboard class.

Getting ready

The recipe will depend on there being some bindings in InputManager. If you already have a game, this would not be a problem. If not, it will describe how to add a couple of bindings for the example to work.

How to do it...

Following the pattern from previous recipes, we'll start defining the controls, then move on to the screen, and finally work on the ...

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