Interface Scene
- All Known Implementing Classes:
Demo2D,Demo3D,DemoIsometric,Effect,OrientationLockScreen,ParticleWipe,PerformanceMonitor,SplashScreen,SwipeTracker
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Only one scene can be active at the same time, but it is possible to attach sub-scenes to the currently active scene. These sub-scenes can contain their own logic, but cannot outlive their parent scene. When the active scene is changed, both the scene itself and its sub-scenes will be terminated and the stage will be cleared in preparation for the next scene.
The currently active scene (and its sub-scenes) receive access to the
SceneContext, which is provided by the renderer via callback
methods.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidend(SceneContext context) Clean-up logic that is performed every time the scene ends.default booleanIndicates the scene has been completed and no longer wishes to receive frame updates.default voidstart(SceneContext context) Initialization logic that should be performed when the scene is started.voidupdate(SceneContext context, float deltaTime) Called during every frame update for as long as the scene is active.
-
Method Details
-
start
Initialization logic that should be performed when the scene is started. Note that this method is called *every* time the scene is started, not just the first time.This method is optional, the default implementation does nothing.
-
update
Called during every frame update for as long as the scene is active.deltaTimeindicates the elapsed time since the last frame, in seconds. -
end
Clean-up logic that is performed every time the scene ends.This method is optional, the default implementation does nothing.
-
isCompleted
default boolean isCompleted()Indicates the scene has been completed and no longer wishes to receive frame updates.If this scene is the currently active scene, it might not actually end until a new scene is requested.
If this scene is a completed sub-scene, meaning there is a parent scene which is still active, this sub-scene will end after the current frame.
-