|
@@ -5,6 +5,7 @@
|
|
:keywords: documentation, project, deployment, sdk
|
|
:keywords: documentation, project, deployment, sdk
|
|
:relfileprefix: ../
|
|
:relfileprefix: ../
|
|
:imagesdir: ..
|
|
:imagesdir: ..
|
|
|
|
+:experimental:
|
|
ifdef::env-github,env-browser[:outfilesuffix: .adoc]
|
|
ifdef::env-github,env-browser[:outfilesuffix: .adoc]
|
|
|
|
|
|
|
|
|
|
@@ -13,12 +14,12 @@ The jMonkeyEngine SDK makes it easy to get started with developing 3-D games bas
|
|
|
|
|
|
== Creating a New jMonkeyEngine Project
|
|
== Creating a New jMonkeyEngine Project
|
|
|
|
|
|
-. Choose File > New Project from the main menu.
|
|
|
|
-. In the New Project Wizard, select the template JME3 > Basic Game
|
|
|
|
|
|
+. Choose `menu:File[New Project]` from the main menu.
|
|
|
|
+. In the New Project Wizard, select the template `menu:JME3[Basic Game]`.
|
|
. Click next to specify a project name, and the path where to store your new project.
|
|
. Click next to specify a project name, and the path where to store your new project.
|
|
. Click Finish. A skeleton application is created and opens in the Project Explorer.
|
|
. Click Finish. A skeleton application is created and opens in the Project Explorer.
|
|
** This basic jme3 application is based on the SimpleApplication class to allow an easy start with jme3.
|
|
** This basic jme3 application is based on the SimpleApplication class to allow an easy start with jme3.
|
|
-** You can click the run button to run it: You will see a jMonkey cube.
|
|
|
|
|
|
+** You can click the run button to run it: You will see a blue cube.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -28,7 +29,7 @@ The jMonkeyEngine SDK makes it easy to get started with developing 3-D games bas
|
|
image::sdk/jmonkeyplatform-docu-4.png[jmonkeyplatform-docu-4.png,width="421",height="298"]
|
|
image::sdk/jmonkeyplatform-docu-4.png[jmonkeyplatform-docu-4.png,width="421",height="298"]
|
|
|
|
|
|
|
|
|
|
-Let's have a look at the abstract project structure in the Project Explorer (ctrl-1).
|
|
|
|
|
|
+Let's have a look at the abstract project structure in the Project Explorer (kbd:[Ctrl]+kbd:[1]).
|
|
|
|
|
|
* *Project Assets node:* These directories have been created for you to store your games assets, such as fonts, materials, models, shaders, sounds, and textures. For a newly created project, these directories are empty.
|
|
* *Project Assets node:* These directories have been created for you to store your games assets, such as fonts, materials, models, shaders, sounds, and textures. For a newly created project, these directories are empty.
|
|
* *Source Packages node:* This is where you manage your packages and classes. For a newly created project, it contains one package and one class, `Main.java`. Double click `Main.java` to open it in the editor.
|
|
* *Source Packages node:* This is where you manage your packages and classes. For a newly created project, it contains one package and one class, `Main.java`. Double click `Main.java` to open it in the editor.
|
|
@@ -37,7 +38,7 @@ Let's have a look at the abstract project structure in the Project Explorer (ctr
|
|
|
|
|
|
=== Directory Structure
|
|
=== Directory Structure
|
|
|
|
|
|
-Now let's have a look at the project's file structure in the File Explorer (ctrl-2). This explorer shows the physical directory structure on your hard drive.
|
|
|
|
|
|
+Now let's have a look at the project's file structure in the File Explorer (kbd:[Ctrl]+kbd:[2]). This explorer shows the physical directory structure on your hard drive.
|
|
|
|
|
|
* *assets* – This directory corresponds to the Project Assets node. It is needed for the assetManager. This is the recommended internal structure:
|
|
* *assets* – This directory corresponds to the Project Assets node. It is needed for the assetManager. This is the recommended internal structure:
|
|
** `assets/Interface`
|
|
** `assets/Interface`
|
|
@@ -56,24 +57,19 @@ Now let's have a look at the project's file structure in the File Explorer (ctrl
|
|
* *dist* – This directory contains the executable JAR files. (Will be generated by the jMonkeyEngine SDK when you build the project.)
|
|
* *dist* – This directory contains the executable JAR files. (Will be generated by the jMonkeyEngine SDK when you build the project.)
|
|
* *test* – The jMonkeyEngine SDK will store JUnit tests here if you create any. (Optional.)
|
|
* *test* – The jMonkeyEngine SDK will store JUnit tests here if you create any. (Optional.)
|
|
|
|
|
|
-Project Configuration
|
|
|
|
-
|
|
|
|
-Right-Click the project to open the Project properties.
|
|
|
|
-
|
|
|
|
-In the Run section, specify the main class of your project. (Pressing F6 runs this main class.)
|
|
|
|
-In the Run section, you can optionally configure JVM options and command line parameters *(in most cases set the-Xms VMOption [NUMBER] m for the memory usage. for example (-Xms500m). see link:http://performance.netbeans.org/howto/jvmswitches/[http://performance.netbeans.org/howto/jvmswitches/])*.
|
|
|
|
-In the Application section, specify the game title (by default the game will be named BasicGame).
|
|
|
|
-In the Application section, specify the vendor name (your name), a short description, your project's homepage, and a splash screen.
|
|
|
|
-
|
|
|
|
|
|
|
|
=== Project Configuration
|
|
=== Project Configuration
|
|
|
|
|
|
-Right-Click the project to open the Project properties.
|
|
|
|
|
|
+[RMB] select the project and from the menu open the project `Properties`.
|
|
|
|
|
|
-* In the Run section, specify the main class of your project. (Pressing F6 runs this main class.)
|
|
|
|
-* In the Run section, you can optionally configure JVM options and command line parameters.
|
|
|
|
-* In the Application section, specify the game title (by default the game will be named `BasicGame`).
|
|
|
|
-* In the Application section, specify the vendor name (your name), a short description, your project's homepage, and a splash screen.
|
|
|
|
|
|
+* In the `Run` section:
|
|
|
|
+** Specify the main class of your project. (Pressing kbd:[F6] runs this main class.)
|
|
|
|
+** You can optionally configure JVM options and command line parameters. In most cases, set the `-Xms VMOption [NUMBER] m` for the memory usage.
|
|
|
|
+*** For example (-Xms500m).
|
|
|
|
+*** see link:http://performance.netbeans.org/howto/jvmswitches/[http://performance.netbeans.org/howto/jvmswitches/]).
|
|
|
|
+* In the Application section:
|
|
|
|
+** Specify the game title (by default the game will be named `BasicGame`).
|
|
|
|
+** Specify the vendor name (your name), a short description, your project's homepage, and a splash screen.
|
|
|
|
|
|
|
|
|
|
=== Clean, Build and Run Cycle
|
|
=== Clean, Build and Run Cycle
|
|
@@ -82,19 +78,19 @@ Right-Click the project to open the Project properties.
|
|
image::sdk/jmonkeyplatform-docu-5.png[jmonkeyplatform-docu-5.png,width="421",height="298",align="right"]
|
|
image::sdk/jmonkeyplatform-docu-5.png[jmonkeyplatform-docu-5.png,width="421",height="298",align="right"]
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
[IMPORTANT]
|
|
[IMPORTANT]
|
|
====
|
|
====
|
|
-Pressing *F6 builds & runs* the _main_ class of the _main project_. If there are several classes, or several projects, you have to specify which one you want F6 to run. Right-click a project and choose Set As Main Project, then right-click the project again and choose Properties > Run and choose a Main Class. +
|
|
|
|
-To build and run the main() of _any file that is open in the editor_, press *Shift-F6* !
|
|
|
|
|
|
+Pressing *kbd:[F6] builds & runs* the _main_ class of the _main project_. If there are several classes, or several projects, you have to specify which one you want kbd:[F6] to run. btn:[RMB] select a project and choose `Set As Main Project`, then btn:[RMB] select the project again and choose `menu:Properties[Run]` and choose a Main Class.
|
|
|
|
+
|
|
|
|
+To build and run the main() of _any file that is open in the editor_, press kbd:[Shift]+kbd:[F6]!
|
|
====
|
|
====
|
|
|
|
|
|
|
|
|
|
-* Right-Click the project and use the context-menu to clean all generated classes and JARs.
|
|
|
|
-* Right-Click individual files with a main method to build and run them. (Shift-F6)
|
|
|
|
-* Press the Run button (green arrow in the toolbar) to build and run the project. (F6)
|
|
|
|
|
|
+* btn:[RMB] select the project and use the context-menu to clean all generated classes and JARs.
|
|
|
|
+* btn:[RMB] select individual files with a main method to build and run them. (kbd:[Shift]+kbd:[F6])
|
|
|
|
+* Press the btn:[Run] button (green arrow in the toolbar) to build and run the project. (kbd:[F6])
|
|
|
|
|
|
-*More than one project open?* The toolbar buttons and the F-keys are bound to the main project, which is shown in bold in the Project Explorer. Right-click a project and select Set As Main Project to make it respond to the toolbar buttons and F-keys.
|
|
|
|
|
|
+*More than one project open?* The toolbar buttons and the F-keys are bound to the main project, which is shown in bold in the Project Explorer. btn:[RMB] select a project and select `Set As Main Project` to make it respond to the toolbar buttons and F-keys.
|
|
|
|
|
|
*Worried About Proprietary Lock-in?* You are never locked into the jMonkeyEngine SDK: At any time, you can change into your project directory on the command line, and clean, build, and run your project, using non-proprietary Apache Ant commands:
|
|
*Worried About Proprietary Lock-in?* You are never locked into the jMonkeyEngine SDK: At any time, you can change into your project directory on the command line, and clean, build, and run your project, using non-proprietary Apache Ant commands:
|
|
|
|
|
|
@@ -106,7 +102,7 @@ ant clean; ant jar; ant run;
|
|
|
|
|
|
== Development Process
|
|
== Development Process
|
|
|
|
|
|
-* *Creating new files and packages:* Select the Source Packages node (or any of its subnodes), and press ctrl-N (File→New File): Use the New File wizard to create new Java classes, Java packages, Java beans, Swing forms, JUnit files, j3m Materials, j3o scenes, j3f filters, and many more.
|
|
|
|
|
|
+* *Creating new files and packages:* Select the Source Packages node (or any of its subnodes), and press kbd:[Ctrl]+kbd:[N] (`menu:File[New File]`): Use the `New File` wizard to create new Java classes, Java packages, Java beans, Swing forms, JUnit files, j3m Materials, j3o scenes, j3f filters, and many more.
|
|
* *Editing files:* Open the Projects Explorer and double-click a Java file from the Source Packages to open it in the Editor. The <<sdk/code_editor#,jMonkeyEngine SDK Code Editor>> assists you in many ways, including syntactic and semantic code coloring, code completion, and javadoc.
|
|
* *Editing files:* Open the Projects Explorer and double-click a Java file from the Source Packages to open it in the Editor. The <<sdk/code_editor#,jMonkeyEngine SDK Code Editor>> assists you in many ways, including syntactic and semantic code coloring, code completion, and javadoc.
|
|
* *Adding Assets:*
|
|
* *Adding Assets:*
|
|
** You can <<sdk/model_loader_and_viewer#,import models, scenes, and materials>> as assets into your project.
|
|
** You can <<sdk/model_loader_and_viewer#,import models, scenes, and materials>> as assets into your project.
|
|
@@ -129,20 +125,20 @@ You may want to use external Java libraries in your jME project, for example con
|
|
|
|
|
|
Add the library to the global library list:
|
|
Add the library to the global library list:
|
|
|
|
|
|
-* Select Tools→Libraries in the main menu.
|
|
|
|
-* Click “New Library, enter a name for the library, and press OK
|
|
|
|
-* In the “Classpath tab, press “Add JAR/Folder and select the jar file(s) needed for the library
|
|
|
|
-* (Optional) In the “JavaDoc tab, press “Add ZIP/Folder and select the javadoc for the library, as zip file or folder.
|
|
|
|
-* (Optional) In the “Sources tab you can select a folder or jar file containing the source files of the library.
|
|
|
|
-* Press OK
|
|
|
|
|
|
+* Select menu:Tools[Libraries] in the main menu.
|
|
|
|
+* Click "`New Library`", enter a name for the library, and press btn:[OK].
|
|
|
|
+* In the "`Classpath`" tab, press "`Add JAR/Folder`" and select the jar file(s) needed for the library.
|
|
|
|
+* (Optional) In the "`JavaDoc`" tab, press "`Add ZIP/Folder`" and select the javadoc for the library, as zip file or folder.
|
|
|
|
+* (Optional) In the "`Sources`" tab you can select a folder or jar file containing the source files of the library.
|
|
|
|
+* Press btn:[OK].
|
|
|
|
|
|
Add the library to a project:
|
|
Add the library to a project:
|
|
|
|
|
|
-* Right-Click your project and select “Properties
|
|
|
|
-* Select “Libaries on the left and then press “Add Library
|
|
|
|
-* Select the library from the list and press OK
|
|
|
|
|
|
+* btn:[RMB] select your project and select "`Properties`".
|
|
|
|
+* Select "`Libaries`" on the left and then press "`Add Library`".
|
|
|
|
+* Select the library from the list and press btn:[OK].
|
|
|
|
|
|
-That's it, your project can now use the external library. If you also linked the javadoc and sources, the SDK will assist you with javadoc popups, code completion (ctrl-space) and source navigation (ctrl-click).
|
|
|
|
|
|
+That's it, your project can now use the external library. If you also linked the javadoc and sources, the SDK will assist you with javadoc popups, code completion (kbd:[Ctrl]+kbd:[Space]) and source navigation (kbd:[Ctrl]+btn:[LMB] ).
|
|
|
|
|
|
|
|
|
|
=== Application Deployment
|
|
=== Application Deployment
|
|
@@ -156,7 +152,7 @@ The SDK contains <<sdk/sample_code#,Sample Code>> (read more).
|
|
|
|
|
|
Open the Source Packages node of the JmeTests project.
|
|
Open the Source Packages node of the JmeTests project.
|
|
|
|
|
|
-* Right-click the `JME3Tests` project and choose Run. +
|
|
|
|
|
|
+* btn:[RMB] select the `JME3Tests` project and choose Run. +
|
|
Choose samples from the TestChooser and try out the included demos.
|
|
Choose samples from the TestChooser and try out the included demos.
|
|
* Browse a demo's source code in the SDK's Project window to learn how a feature is implemented and used.
|
|
* Browse a demo's source code in the SDK's Project window to learn how a feature is implemented and used.
|
|
* Feel free to modify the code samples and experiment! If you break something, you can always recreate the packaged samples from the `JME3 Tests` template.
|
|
* Feel free to modify the code samples and experiment! If you break something, you can always recreate the packaged samples from the `JME3 Tests` template.
|