Book Image

JMonkeyEngine 3.0 Cookbook

By : Rickard Eden
Book Image

JMonkeyEngine 3.0 Cookbook

By: Rickard Eden

Overview of this book

Table of Contents (17 chapters)
jMonkeyEngine 3.0 Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Introduction


Nifty GUI is operated using screens. A screen could be, for example, an in-game (HUD) heads-up display or the same game's main menu. Screens are built using XML and Nifty's own set of tags. On each screen, there can be layers that are drawn on top of each other according to their order.

On a screen, objects cascade similarly as on a web page, that is, from top to bottom or left to right, depending on the settings. The following code is an example of what a simple screen might look like:

<nifty xmlns="http://nifty-gui.sourceforge.net/nifty-1.3.xsd"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://nifty-gui.sourceforge.net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd">
  <useStyles filename="nifty-default-styles.xml" />
  <useControls filename="nifty-default-controls.xml" />
    
  <registerSound id="showWindow" filename="Sound/Effects/Beep.ogg" />
    
  <screen id="main" controller="gui...