-
Book Overview & Buying
-
Table Of Contents
JMonkeyEngine 3.0 Cookbook
By :
It is possible to relay most game-related information to the player using a console. However, it's a very basic form of communication. Modern players often expect more graphical ways of receiving information. In this recipe, we'll explore one way of doing this using Nifty. We'll create a dynamic message queue with messages moving in from the right of the screen and fading out once clicked.
It actually doesn't require that many lines of code.
The XML for this recipe can be completed by performing the following five steps:
We start by defining a new <controlDefinition name="gameMessage">.
Inside this, we should add a panel element, and inside this panel element, add two <control name="label"> elements with the ID #title and other contents.
The panel should also have two effects, one onShow trigger and one onHide trigger with move and fade effects respectively, as shown in the following code:
<onShow name="move" mode="fromOffset" offsetX...
Change the font size
Change margin width
Change background colour