Class Demo2D

java.lang.Object
nl.colorize.multimedialib.tool.Demo2D
All Implemented Interfaces:
ErrorHandler, Scene

public class Demo2D extends Object implements Scene, ErrorHandler
Simple demo application that displays a number of animated Mario sprites on top of a black background.

application when using the framework to implement an application. Second, it can be used for verification purposes to determine if a new platform is fully supported.

The demo application can be started from the command line using the DemoLauncher. It can also be embedded in applications by creating an instance of this class from the application code.

  • Field Details

    • DEFAULT_CANVAS_WIDTH

      public static final int DEFAULT_CANVAS_WIDTH
      See Also:
    • DEFAULT_CANVAS_HEIGHT

      public static final int DEFAULT_CANVAS_HEIGHT
      See Also:
    • BUTTON_WIDTH

      protected static final int BUTTON_WIDTH
      See Also:
    • BUTTON_HEIGHT

      protected static final int BUTTON_HEIGHT
      See Also:
    • RED_BUTTON

      protected static final ColorRGB RED_BUTTON
    • GREEN_BUTTON

      protected static final ColorRGB GREEN_BUTTON
    • PINK_BUTTON

      protected static final ColorRGB PINK_BUTTON
    • BLUE_BUTTON

      protected static final ColorRGB BLUE_BUTTON
    • ORANGE_BUTTON

      protected static final ColorRGB ORANGE_BUTTON
    • MARIO_SPRITES_FILE

      protected static final nl.colorize.util.ResourceFile MARIO_SPRITES_FILE
  • Constructor Details

    • Demo2D

      public Demo2D()
  • Method Details

    • start

      public void start(SceneContext context)
      Description copied from interface: Scene
      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.

      Specified by:
      start in interface Scene
    • onError

      public void onError(SceneContext context, Exception cause)
      Specified by:
      onError in interface ErrorHandler
    • 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
    • addMarios

      public void addMarios()