Package nl.colorize.multimedialib.scene
Class SceneManager
- java.lang.Object
-
- nl.colorize.multimedialib.scene.SceneManager
-
- All Implemented Interfaces:
Renderable,SceneContext,Updatable
public class SceneManager extends java.lang.Object implements Updatable, Renderable, SceneContext
Implements a mechanism that divides the application life cycle into a number of separate scenes. One scene is marked as currently active, and will receive frame updates and render graphics for as a long as it is active. Scenes will also receive notifications whenever the active scene changes.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SceneManagerattach(Renderer renderer)Creates a newSceneManagerand immediately attaches it as a callback to the specified renderer.voidchangeScene(Scene requestedScene)Requests to change the active scene after the current frame has been completed.ScenegetActiveScene()ApplicationDatagetApplicationData(java.lang.String appName)floatgetAverageFPS()floatgetAverageFrameTime()CanvasgetCanvas()InputDevicegetInputDevice()MediaLoadergetMediaLoader()voidrender(GraphicsContext graphics)voidupdate(float deltaTime)Updates this object for the current frame.
-
-
-
Method Detail
-
changeScene
public void changeScene(Scene requestedScene)
Requests to change the active scene after the current frame has been completed.- Specified by:
changeScenein interfaceSceneContext
-
getActiveScene
public Scene getActiveScene()
-
update
public void update(float deltaTime)
Description copied from interface:UpdatableUpdates this object for the current frame.
-
render
public void render(GraphicsContext graphics)
- Specified by:
renderin interfaceRenderable
-
getCanvas
public Canvas getCanvas()
- Specified by:
getCanvasin interfaceSceneContext
-
getInputDevice
public InputDevice getInputDevice()
- Specified by:
getInputDevicein interfaceSceneContext
-
getMediaLoader
public MediaLoader getMediaLoader()
- Specified by:
getMediaLoaderin interfaceSceneContext
-
getApplicationData
public ApplicationData getApplicationData(java.lang.String appName)
- Specified by:
getApplicationDatain interfaceSceneContext
-
getAverageFPS
public float getAverageFPS()
- Specified by:
getAverageFPSin interfaceSceneContext
-
getAverageFrameTime
public float getAverageFrameTime()
- Specified by:
getAverageFrameTimein interfaceSceneContext
-
attach
public static SceneManager attach(Renderer renderer)
Creates a newSceneManagerand immediately attaches it as a callback to the specified renderer.
-
-