|
@@ -52,11 +52,14 @@ The HUD contains:
|
|
|
|
|
|
image::jme3/advanced/nifty-screen-layer-panel.png[nifty-screen-layer-panel.png,width="366",height="136",align="left"]
|
|
|
|
|
|
-
|
|
|
Create an empty *screen*.xml file in the `assets/Interface/` directory of your project.
|
|
|
|
|
|
-. btn:[RMB] click on `menu:Interface[New>Other>GUI>Empty Gui]` followed by the btn:[Next >] button.
|
|
|
-. Name the file "`screen`" and when ready select btn:[Finish].
|
|
|
+CAUTION: Do not use the SDK built in Nifty file editor. It does not work and is full of bugs that will lead to significant hair loss. Instead, create a empty XML file.
|
|
|
+
|
|
|
+. btn:[RMB] click on `menu:Interface[New>Other>XML>XML Document]` followed by the btn:[Next >] button.
|
|
|
+//. btn:[RMB] click on `menu:Interface[New>Other>GUI>Empty Gui]` followed by the btn:[Next >] button.
|
|
|
+. Name the file "`screen`" and when ready select btn:[Next >].
|
|
|
+. Accept the default selection of "`Well-formed Document`" by clicking the btn:[Finish] button.
|
|
|
|
|
|
Afterwards create the directory `assets/Interface/Fonts` and add a new font e.g. Arial.
|
|
|
|
|
@@ -75,7 +78,7 @@ One XML file can contain several, or even all screens. As a reminder: Nifty disp
|
|
|
|
|
|
=== Make Screens
|
|
|
|
|
|
-The following minimal XML file contains a start screen and a HUD screen. (Neither has been defined yet.)
|
|
|
+The following minimal XML file contains a start screen and a HUD screen. (Neither has been defined yet.) Copy and paste the following code into your scene.xml file.
|
|
|
|
|
|
[source,xml]
|
|
|
----
|
|
@@ -94,13 +97,15 @@ The following minimal XML file contains a start screen and a HUD screen. (Neithe
|
|
|
|
|
|
Every Nifty +++<abbr title="Graphical User Interface">GUI</abbr>+++ must have a start screen. The others (in this example, the HUD screen) are optional.
|
|
|
|
|
|
+See: <<jme3/advanced/nifty_gui_overlay#,Nifty Gui Overlay>> to view your document as we progress through this tutorial.
|
|
|
+
|
|
|
NOTE: In the following examples, the XML schema header is abbreviated to just `<nifty>`.
|
|
|
|
|
|
|
|
|
=== Make Layers
|
|
|
|
|
|
The following minimal XML file shows how we added layers to the start screen and HUD screen.
|
|
|
-Delete all from the file and add following code:
|
|
|
+Delete all from the file and add following code.
|
|
|
|
|
|
[source,xml]
|
|
|
----
|
|
@@ -187,12 +192,13 @@ image::jme3/advanced/nifty-gui-panels.png[nifty-gui-panels.png,width="",height="
|
|
|
|
|
|
== Adding Content to Panels
|
|
|
|
|
|
-See also link:http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Layout_Introduction[Layout Introduction] on the Nifty +++<abbr title="Graphical User Interface">GUI</abbr>+++ site.
|
|
|
+See also link:https://versaweb.dl.sourceforge.net/project/nifty-gui/nifty-gui/1.3.2/nifty-gui-the-manual-1.3.2.pdf[Nifty GUI - the Manual: Layouts] on the Nifty +++<abbr title="Graphical User Interface">GUI</abbr>+++ site.
|
|
|
|
|
|
|
|
|
=== Add Images
|
|
|
|
|
|
-The link:http://hub.jmonkeyengine.org/wiki/lib/exe/fetch.php/jme3:advanced:start-background.png[start-background.png] image is a fullscreen background picture. Add it to `Interface`. In the `start` screen, add the following image element:
|
|
|
+The
|
|
|
+<<../images/jme3/advanced/start-background.png#,start-background.png>> image is a fullscreen background picture. Add it to `Interface`. In the `start` screen, add the following image element:
|
|
|
|
|
|
[source,xml]
|
|
|
----
|