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

Loading the screen


In this recipe, we'll develop a loading screen along with a controller for the game. It'll cover the most important aspects of the loading screen, such as showing a text and image for what it's loading and an indicator that shows the system is working.

Before starting this, it's recommended that you have a basic understanding of how to set up Nifty in an application and how to create screens and controllers. Have a look at the previous recipe, Initializing Nifty managing an options menu, if you are unsure about this.

How to do it...

We begin by creating the XML for the loading screen. Perform the following nine steps to do this:

  1. Create a new file called loadingScreen.xml and load Nifty-default-styles and Nifty-default-controls. Optionally, we can also include optionsMenu from the previous recipe.

  2. The first element we need is a <screen> element:

    <screen id="loadingScreen" controller="gui.controller.LoadingScreenController">
  3. Inside this, we define a <layer> element...