-
Book Overview & Buying
-
Table Of Contents
JMonkeyEngine 3.0 Cookbook
By :
In this recipe, we will make an AppState object, which will handle the player input for a character. It's a great way to add functionality to the application in a modular way. The AppState object we create here could easily be added during the game and removed or disabled during cut scenes or while in the game menu.
We won't require any special assets for this recipe, but it will be beneficial to have a basic understanding of how AppState works and its purpose in jMonkeyEngine. This particular implementation of the recipe will use the character-control class created in the previous example. It can still be used to manipulate a spatial object directly without the GameCharacterControl class. This recipe will provide pointers on where to do this.
To attach an input AppState object, perform the following steps:
Start off by creating a class called InputAppState, extending AbstractAppState, and implementing ActionListener and AnalogListener...
Change the font size
Change margin width
Change background colour