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
:FlyCamAppState
is by default attached as well and can
be removed by calling stateManager.detach(stateManager.getState(FlyCamAppState.class));
Modifier and Type | Field and Description |
---|---|
protected FlyByCamera |
flyCam |
protected BitmapText |
fpsText |
protected BitmapFont |
guiFont |
protected Node |
guiNode |
static java.lang.String |
INPUT_MAPPING_CAMERA_POS |
static java.lang.String |
INPUT_MAPPING_EXIT |
static java.lang.String |
INPUT_MAPPING_HIDE_STATS |
static java.lang.String |
INPUT_MAPPING_MEMORY |
protected Node |
rootNode |
protected boolean |
showSettings |
assetManager, audioRenderer, cam, context, guiViewPort, inputEnabled, inputManager, joyInput, keyInput, listener, lostFocusBehavior, mouseInput, paused, prof, renderer, renderManager, settings, speed, stateManager, timer, touchInput, viewPort
Constructor and Description |
---|
SimpleApplication() |
SimpleApplication(AppState... initialStates) |
Modifier and Type | Method and Description |
---|---|
FlyByCamera |
getFlyByCamera()
Retrieves flyCam
|
Node |
getGuiNode()
Retrieves guiNode
|
Node |
getRootNode()
Retrieves rootNode
|
float |
getSpeed()
Returns the application's speed.
|
void |
initialize()
Do not call manually.
|
boolean |
isShowSettings() |
protected BitmapFont |
loadGuiFont()
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-up
|
void |
setSpeed(float speed)
Changes the application's speed.
|
abstract void |
simpleInitApp() |
void |
simpleRender(RenderManager rm) |
void |
simpleUpdate(float tpf) |
void |
start()
Starts the application in
display mode. |
void |
update()
Do not call manually.
|
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
public static final java.lang.String INPUT_MAPPING_EXIT
public static final java.lang.String INPUT_MAPPING_CAMERA_POS
public static final java.lang.String INPUT_MAPPING_MEMORY
public static final java.lang.String INPUT_MAPPING_HIDE_STATS
protected Node rootNode
protected Node guiNode
protected BitmapText fpsText
protected BitmapFont guiFont
protected FlyByCamera flyCam
protected boolean showSettings
public SimpleApplication()
public SimpleApplication(AppState... initialStates)
public void start()
LegacyApplication
display
mode.start
in interface Application
start
in class LegacyApplication
LegacyApplication.start(com.jme3.system.JmeContext.Type)
public float getSpeed()
public void setSpeed(float speed)
speed
- The speed to set.public FlyByCamera getFlyByCamera()
public Node getGuiNode()
public Node getRootNode()
public boolean isShowSettings()
public void setShowSettings(boolean showSettings)
showSettings
- Sets true/falseprotected BitmapFont loadGuiFont()
public void initialize()
LegacyApplication
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.
initialize
in interface SystemListener
initialize
in class LegacyApplication
public void update()
LegacyApplication
update
in interface SystemListener
update
in class LegacyApplication
public void setDisplayFps(boolean show)
public void setDisplayStatView(boolean show)
public abstract void simpleInitApp()
public void simpleUpdate(float tpf)
public void simpleRender(RenderManager rm)