Class FluentScene

java.lang.Object
nl.colorize.multimedialib.scene.FluentScene
All Implemented Interfaces:
Scene

public class FluentScene extends Object implements Scene
Implementation of the Scene interface that delegates to callback functions. This class is intended for dynamically creating sub-scenes.
  • Constructor Details

    • FluentScene

      public FluentScene(Updatable onFrame)
  • Method Details

    • withCompletion

      public FluentScene withCompletion(BooleanSupplier completed, Runnable onComplete)
    • withCompletion

      public FluentScene withCompletion(BooleanSupplier completed)
    • update

      public void update(SceneContext context, float deltaTime)
      Description copied from interface: Scene
      Called during every frame update for as long as the scene is active. deltaTime indicates the elapsed time since the last frame, in seconds.
      Specified by:
      update in interface Scene
    • end

      public void end(SceneContext context)
      Description copied from interface: Scene
      Clean-up logic that is performed every time the scene ends.

      This method is optional, the default implementation does nothing.

      Specified by:
      end in interface Scene
    • isCompleted

      public boolean isCompleted()
      Description copied from interface: Scene
      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.

      Specified by:
      isCompleted in interface Scene