Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying JMonkeyEngine 3.0 Cookbook
  • Table Of Contents Toc
JMonkeyEngine 3.0 Cookbook

JMonkeyEngine 3.0 Cookbook

By : Rickard Eden
4 (7)
close
close
JMonkeyEngine 3.0 Cookbook

JMonkeyEngine 3.0 Cookbook

4 (7)
By: Rickard Eden

Overview of this book

If you are a jMonkey developer or a Java developer who is interested to delve further into the game making process to expand your skillset and create more technical games, then this book is perfect for you.
Table of Contents (12 chapters)
close
close
11
Index

Creating an inventory screen


In this recipe, we'll create an inventory screen, which is very common, mostly in RPGs. To do this, we'll use the Droppable and Draggable components in Nifty and create an InventoryItem class to help us differentiate different the types of items (and hence, where they can be attached). This time, we'll use both XML to create the static components and the Java Builder interface to build the inventory (or backpack) slots. The reason is that in many games, the amount of inventory a character has varies.

How to do it...

We begin by creating the controls, which are the key components of this method. This can be done by performing the following four steps:

  1. First, we create a new controls file, inventoryControls.xml, with the <nifty-controls> tag.

  2. Inside this, we first define <controlDefinition name="itemSlot"> with the following content:

    <control name="droppable" backgroundColor="#fff5" width="64px" height="64px" margin="1px" childLayout="center"/>
  3. Then...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
JMonkeyEngine 3.0 Cookbook
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon