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

Creating an RPG dialog screen

As the title implies, we'll explore a method to create a dialog screen, similar to those found in many RPGs. It'll display an image of the character being talked to, but this could be replaced by using some clever camera work to zoom in on a character instead.

It will use a Nifty ListBox to display the player's available dialog options and a listener to find out the result of the player's choice.

There most likely has to be some dialog tree system that backs the implementation. For this example, we'll use a template class called DialogNode. This will have information about a character's name, image, and what it says. It also contains the player's options as a string array, as shown in the following screenshot. What's ...

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