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 SummaryFieldsModifier and TypeFieldDescriptionprotected FlyByCameraprotected BitmapTextprotected BitmapFontprotected Nodestatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected Nodeprotected booleanFields inherited from class com.jme3.app.LegacyApplicationassetManager, audioRenderer, cam, context, guiViewPort, inputEnabled, inputManager, joyInput, keyInput, listener, lostFocusBehavior, mouseInput, paused, prof, renderer, renderManager, settings, speed, stateManager, timer, touchInput, viewPort
- 
Constructor SummaryConstructors
- 
Method SummaryModifier 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.LegacyApplicationcreateCanvas, 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
- 
showSettingsprotected boolean showSettings
 
- 
- 
Constructor Details- 
SimpleApplicationpublic SimpleApplication()
- 
SimpleApplication
 
- 
- 
Method Details- 
startpublic void start()Description copied from class:LegacyApplicationStarts the application indisplaymode.- Specified by:
- startin interface- Application
- Overrides:
- startin class- LegacyApplication
- See Also:
 
- 
getSpeedpublic float getSpeed()Returns the application's speed.- Returns:
- The speed of the application.
 
- 
setSpeedpublic void setSpeed(float speed) Changes the application's speed. 0.0f prevents the application from updating.- Parameters:
- speed- The speed to set.
 
- 
getFlyByCameraRetrieves flyCam- Returns:
- flyCam Camera object
 
- 
getGuiNodeRetrieves guiNode- Returns:
- guiNode Node object
 
- 
getRootNodeRetrieves rootNode- Returns:
- rootNode Node object
 
- 
isShowSettingspublic boolean isShowSettings()
- 
setShowSettingspublic void setShowSettings(boolean showSettings) Toggles settings window to display at start-up- Parameters:
- showSettings- Sets true/false
 
- 
loadGuiFontCreates the font that will be set to the guiFont field and subsequently set as the font for the stats text.- Returns:
- the loaded BitmapFont
 
- 
initializepublic 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 interface- SystemListener
- Overrides:
- initializein class- LegacyApplication
 
- 
updatepublic void update()Description copied from class:LegacyApplicationDo not call manually. Callback from ContextListener.- Specified by:
- updatein interface- SystemListener
- Overrides:
- updatein class- LegacyApplication
 
- 
setDisplayFpspublic void setDisplayFps(boolean show) 
- 
setDisplayStatViewpublic void setDisplayStatView(boolean show) 
- 
simpleInitApppublic abstract void simpleInitApp()
- 
simpleUpdatepublic void simpleUpdate(float tpf) 
- 
simpleRender
 
-