Interface Scene

  • All Known Implementing Classes:
    Demo2D, Demo3D, MenuScene, SceneWrapper

    public interface Scene
    Represents a discrete part or phase of an application, that is active for some period of time. Simple applications might consist of a single scene, complex applications can have dozens. Scenes can contain logic, rendering, though they will typically do both.

    Scenes will receive updates at various points throughout their life cycle: when the scene is started (which can occur multiple times depending on the application flow), and then frame updates and rendering when the scene is active.

    Scenes contain methods that are similar to Updatable and Drawable, for performing frame updates and drawing graphics respectively. The main difference is that the scene gets full access to the application. Larger scenes can divide their logic and graphics into separate parts using the aforementioned interfaces.

    • Method Detail

      • start

        void start​(Application app)
        Initiallization logic that should be performed every time the scene is started. This method is called by the application that contains the scene.
      • update

        void update​(Application app,
                    float deltaTime)
      • end

        default void end​(Application app)
        Clean-up logic that is performed every time the scene ends. Implementing this method is optional, the default implementation does nothing.