Getting started with Acorus

Ready for some actual code?

HelloAcorus

HelloAcorus is a complete application that provides a starting point for studying and using Acorus. It’s a simple extension of AcorusDemo: one without a FlyByCamera, a DebugKeysAppState, or a StatsAppState.

A help node is displayed in the upper right corner of the viewport. The help node describes the available user actions. Two actions are available:

  • "ScreenShot" (bound to either Sys Rq or Scroll Lock) and

  • "SIMPLEAPP_Exit" (bound to Esc).

Code to handle the "ScreenShot" action is built into ActionApplication. Pressing the bound key causes the application to capture a screenshot and write it to the working directory.

Pressing Esc triggers the "SIMPLEAPP_Exit" action. Code to handle that action is also built into ActionApplication. It causes the application to terminate.

Because action names are intended for display in help nodes, they should ideally be short and descriptive. "SIMPLEAPP_Exit" is part of the JMonkeyEngine legacy, so the buildNode() utility method (which constructs the help node) gives it special treatment. That’s why "exit" is displayed in place of the actual action name.

HelloAcorus is the first in a series of example apps intended for hands-on learning. I expect you to not only study the source code, but to actually run the app as well. Take time now to set up a software development environment for this purpose!

For instance, if you install Git and a Java Development Kit, you should be able to launch example apps from a command shell, like so:

  1. git clone https://github.com/stephengold/Acorus.git

  2. cd Acorus

  3. ./gradlew HelloAcorus

Here’s that link to the HelloAcorus source code again.

Like most of the example apps, HelloAcorus runs in a resizable window.

Summary

  • HelloAcorus is the starting point for both studying and using Acorus.

  • A help node lists the available actions and describes how to trigger them.

  • Action names should be short and descriptive.

  • This is a hands-on tutorial. Please run the apps!