Package nl.colorize.multimedialib.scene
Class Application
- java.lang.Object
-
- nl.colorize.multimedialib.scene.Application
-
- All Implemented Interfaces:
Renderable,Updatable
public class Application extends java.lang.Object implements Updatable, Renderable
Implements a mechanism on top of the renderer 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.
-
-
Constructor Summary
Constructors Constructor Description Application(Renderer renderer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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()InternetAccessgetInternetAccess()MediaLoadergetMediaLoader()RenderergetRenderer()Returns the renderer that is used by this application.voidlockScreenOrientation()Restricts the application to landscape orientation.voidrender(GraphicsContext graphics)voidupdate(float deltaTime)Updates this object for the current frame.
-
-
-
Constructor Detail
-
Application
public Application(Renderer renderer)
-
-
Method Detail
-
changeScene
public void changeScene(Scene requestedScene)
Requests to change the active scene after the current frame has been completed.- Throws:
java.lang.IllegalStateException- if a different scene has already been requested, but that scene has not yet started.
-
getActiveScene
public Scene getActiveScene()
-
lockScreenOrientation
public void lockScreenOrientation()
Restricts the application to landscape orientation. When attempting to use the application in portrait application, the current scene will be suspended and an image will be shown prompting to switch back to landscape orientation.
-
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
-
getRenderer
public Renderer getRenderer()
Returns the renderer that is used by this application.
-
getCanvas
public Canvas getCanvas()
-
getInputDevice
public InputDevice getInputDevice()
-
getMediaLoader
public MediaLoader getMediaLoader()
-
getApplicationData
public ApplicationData getApplicationData(java.lang.String appName)
-
getInternetAccess
public InternetAccess getInternetAccess()
-
getAverageFPS
public float getAverageFPS()
-
getAverageFrameTime
public float getAverageFrameTime()
-
-