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
FieldsModifier and TypeFieldDescriptionprotected FlyByCameraprotected BitmapTextprotected BitmapFontprotected Nodestatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected Nodeprotected booleanFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieves flyCamRetrieves guiNodeRetrieves rootNodefloatgetSpeed()Returns the application's speed.voidDo not call manually.booleanprotected BitmapFontCreates the font that will be set to the guiFont field and subsequently set as the font for the stats text.voidsetDisplayFps(boolean show) voidsetDisplayStatView(boolean show) voidsetShowSettings(boolean showSettings) Toggles settings window to display at start-upvoidsetSpeed(float speed) Changes the application's speed.abstract voidvoidvoidsimpleUpdate(float tpf) voidstart()Starts the application indisplaymode.voidupdate()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:LegacyApplicationStarts the application indisplaymode.- Specified by:
startin interfaceApplication- Overrides:
startin 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:LegacyApplicationDo 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:
initializein interfaceSystemListener- Overrides:
initializein classLegacyApplication
-
update
public void update()Description copied from class:LegacyApplicationDo not call manually. Callback from ContextListener.- Specified by:
updatein interfaceSystemListener- Overrides:
updatein 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
-