Package com.jme3.app

Class SimpleApplication

java.lang.Object
com.jme3.app.LegacyApplication
com.jme3.app.SimpleApplication
All Implemented Interfaces:
Application, SystemListener

public abstract class SimpleApplication extends LegacyApplication
SimpleApplication is the base class for all jME3 Applications. SimpleApplication will display a statistics view using the StatsAppState AppState. It will display the current frames-per-second value on-screen in addition to the statistics. Several keys have special functionality in SimpleApplication:
Esc - Close the application.
C - Display the camera position and rotation in the console.
M - Display memory usage in the console.
A FlyCamAppState is by default attached as well and can be removed by calling stateManager.detach(stateManager.getState(FlyCamAppState.class));
  • Field Details

  • Constructor Details

    • SimpleApplication

      public SimpleApplication()
    • SimpleApplication

      public SimpleApplication(AppState... initialStates)
  • Method Details

    • start

      public void start()
      Description copied from class: LegacyApplication
      Starts the application in display mode.
      Specified by:
      start in interface Application
      Overrides:
      start in class LegacyApplication
      See Also:
    • getSpeed

      public float getSpeed()
      Returns the application's speed.
      Returns:
      The speed of the application.
    • setSpeed

      public void setSpeed(float speed)
      Changes the application's speed. 0.0f prevents the application from updating.
      Parameters:
      speed - The speed to set.
    • getFlyByCamera

      public FlyByCamera getFlyByCamera()
      Retrieves flyCam
      Returns:
      flyCam Camera object
    • getGuiNode

      public Node getGuiNode()
      Retrieves guiNode
      Returns:
      guiNode Node object
    • getRootNode

      public Node getRootNode()
      Retrieves rootNode
      Returns:
      rootNode Node object
    • isShowSettings

      public boolean isShowSettings()
    • setShowSettings

      public void setShowSettings(boolean showSettings)
      Toggles settings window to display at start-up
      Parameters:
      showSettings - Sets true/false
    • loadGuiFont

      protected BitmapFont loadGuiFont()
      Creates the font that will be set to the guiFont field and subsequently set as the font for the stats text.
      Returns:
      the loaded BitmapFont
    • initialize

      public void initialize()
      Description copied from class: LegacyApplication
      Do not call manually. Callback from ContextListener.

      Initializes the Application, by creating a display and default camera. If display settings are not specified, a default 640x480 display is created. Default values are used for the camera; perspective projection with 45° field of view, with near and far values 1 and 1000 units respectively.

      Specified by:
      initialize in interface SystemListener
      Overrides:
      initialize in class LegacyApplication
    • update

      public void update()
      Description copied from class: LegacyApplication
      Do not call manually. Callback from ContextListener.
      Specified by:
      update in interface SystemListener
      Overrides:
      update in class LegacyApplication
    • setDisplayFps

      public void setDisplayFps(boolean show)
    • setDisplayStatView

      public void setDisplayStatView(boolean show)
    • simpleInitApp

      public abstract void simpleInitApp()
    • simpleUpdate

      public void simpleUpdate(float tpf)
    • simpleRender

      public void simpleRender(RenderManager rm)