Package com.jme3.app
Class SimpleApplication
java.lang.Object
com.jme3.app.LegacyApplication
com.jme3.app.SimpleApplication
- All Implemented Interfaces:
Application
,SystemListener
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 Summary
Modifier and TypeFieldDescriptionprotected FlyByCamera
protected BitmapText
protected BitmapFont
protected Node
static final String
static final String
static final String
static final String
protected Node
protected boolean
Fields inherited from class com.jme3.app.LegacyApplication
assetManager, audioRenderer, cam, context, guiViewPort, inputEnabled, inputManager, joyInput, keyInput, listener, lostFocusBehavior, mouseInput, paused, prof, renderer, renderManager, settings, speed, stateManager, timer, touchInput, viewPort
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves flyCamRetrieves guiNodeRetrieves rootNodefloat
getSpeed()
Returns the application's speed.void
Do not call manually.boolean
protected BitmapFont
Creates the font that will be set to the guiFont field and subsequently set as the font for the stats text.void
setDisplayFps
(boolean show) void
setDisplayStatView
(boolean show) void
setShowSettings
(boolean showSettings) Toggles settings window to display at start-upvoid
setSpeed
(float speed) Changes the application's speed.abstract void
void
void
simpleUpdate
(float tpf) void
start()
Starts the application indisplay
mode.void
update()
Do not call manually.Methods inherited from class com.jme3.app.LegacyApplication
createCanvas, destroy, destroyInput, enqueue, enqueue, gainFocus, getAppProfiler, getAssetManager, getAudioRenderer, getCamera, getContext, getGuiViewPort, getInputManager, getListener, getLostFocusBehavior, getRenderer, getRenderManager, getStateManager, getTimer, getViewPort, handleError, isPauseOnLostFocus, loseFocus, requestClose, rescale, reshape, restart, runQueuedTasks, setAppProfiler, setAssetManager, setLostFocusBehavior, setPauseOnLostFocus, setSettings, setTimer, start, start, start, startCanvas, startCanvas, stop, stop
-
Field Details
-
INPUT_MAPPING_EXIT
- See Also:
-
INPUT_MAPPING_CAMERA_POS
- See Also:
-
INPUT_MAPPING_MEMORY
- See Also:
-
INPUT_MAPPING_HIDE_STATS
- See Also:
-
rootNode
-
guiNode
-
fpsText
-
guiFont
-
flyCam
-
showSettings
protected boolean showSettings
-
-
Constructor Details
-
SimpleApplication
public SimpleApplication() -
SimpleApplication
-
-
Method Details
-
start
public void start()Description copied from class:LegacyApplication
Starts the application indisplay
mode.- Specified by:
start
in interfaceApplication
- Overrides:
start
in classLegacyApplication
- 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
Retrieves flyCam- Returns:
- flyCam Camera object
-
getGuiNode
Retrieves guiNode- Returns:
- guiNode Node object
-
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
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 interfaceSystemListener
- Overrides:
initialize
in classLegacyApplication
-
update
public void update()Description copied from class:LegacyApplication
Do not call manually. Callback from ContextListener.- Specified by:
update
in interfaceSystemListener
- Overrides:
update
in classLegacyApplication
-
setDisplayFps
public void setDisplayFps(boolean show) -
setDisplayStatView
public void setDisplayStatView(boolean show) -
simpleInitApp
public abstract void simpleInitApp() -
simpleUpdate
public void simpleUpdate(float tpf) -
simpleRender
-