Package demo
Class ViewPortDemoState
java.lang.Object
com.jme3.app.state.BaseAppState
demo.ViewPortDemoState
- All Implemented Interfaces:
AppState
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcleanup(Application app) Called after the app state is detached or during application shutdown if the state is still attached.protected voidcreateGuiViewPort(int x1, int y1, int x2, int y2, ColorRGBA bgColor) Creates an ortho viewport in the specified section of the screen.protected voidprotected voidinitialize(Application app) Called during initialization once the app state is attached and before onEnable() is called.protected voidCalled when the state was previously enabled but is now disabled either because setEnabled(false) was called or the state is being cleaned up.protected voidonEnable()Called when the state is fully enabled, ie: is attached and isEnabled() is true or when the setEnabled() status changes after the state is attached.voidrender(RenderManager rm) Render the state.protected voidvoidstateDetached(AppStateManager stateManager) Called byAppStateManager.detach(com.jme3.app.state.AppState)when transitioning thisAppStatefrom running to terminating.voidupdate(float tpf) Called to update theAppState.Methods inherited from class com.jme3.app.state.BaseAppState
cleanup, getApplication, getId, getState, getState, getState, getState, getStateManager, initialize, isEnabled, isInitialized, postRender, setEnabled, setId, stateAttached
-
Constructor Details
-
ViewPortDemoState
public ViewPortDemoState()
-
-
Method Details
-
initialize
Description copied from class:BaseAppStateCalled during initialization once the app state is attached and before onEnable() is called.- Specified by:
initializein classBaseAppState- Parameters:
app- the application
-
cleanup
Description copied from class:BaseAppStateCalled after the app state is detached or during application shutdown if the state is still attached. onDisable() is called before this cleanup() method if the state is enabled at the time of cleanup.- Specified by:
cleanupin classBaseAppState- Parameters:
app- the application
-
createGuiViewPort
Creates an ortho viewport in the specified section of the screen. The viewport will be scaled such that adding things to its root scene will be in 1:1 pixel space. -
disposeViewPort
protected void disposeViewPort() -
setupViewPortTest
protected void setupViewPortTest() -
onEnable
protected void onEnable()Description copied from class:BaseAppStateCalled when the state is fully enabled, ie: is attached and isEnabled() is true or when the setEnabled() status changes after the state is attached.- Specified by:
onEnablein classBaseAppState
-
onDisable
protected void onDisable()Description copied from class:BaseAppStateCalled when the state was previously enabled but is now disabled either because setEnabled(false) was called or the state is being cleaned up.- Specified by:
onDisablein classBaseAppState
-
update
public void update(float tpf) Description copied from interface:AppStateCalled to update theAppState. This method will be called every render pass if theAppStateis both attached and enabled.- Specified by:
updatein interfaceAppState- Overrides:
updatein classBaseAppState- Parameters:
tpf- Time since the last call to update(), in seconds.
-
render
Description copied from interface:AppStateRender the state. This method will be called every render pass if theAppStateis both attached and enabled.- Specified by:
renderin interfaceAppState- Overrides:
renderin classBaseAppState- Parameters:
rm- RenderManager
-
stateDetached
Description copied from interface:AppStateCalled byAppStateManager.detach(com.jme3.app.state.AppState)when transitioning thisAppStatefrom running to terminating.There is no assumption about the thread from which this function is called, therefore it is unsafe to modify the scene graph from this method. Please use
AppState.cleanup()instead.- Specified by:
stateDetachedin interfaceAppState- Overrides:
stateDetachedin classBaseAppState- Parameters:
stateManager- The state manager from which the state was detached from.
-