Package arc

Interface ApplicationListener

All Known Implementing Classes:
ApplicationCore, ClientLauncher, Control, Logic, NetClient, NetServer, Renderer, UI

public interface ApplicationListener

An ApplicationListener is called when the Application is created, resumed, rendering, paused or destroyed. All methods are called in a thread that has the OpenGL context current. You can thus safely create and manipulate graphics resources.

The ApplicationListener interface follows the standard Android activity life-cycle and is emulated on the desktop accordingly.

  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Called when the Application is destroyed.
    default void
    Called when the applications exits gracefully, either through `Core.app.exit()` or through a window closing.
    default void
    Called when an external file is dropped into the window, e.g from the desktop.
    default void
    Called when the Application is first created.
    default void
    Called when the Application is paused, usually when it's not active or visible on screen.
    default void
    resize(int width, int height)
    Called when the Application is resized.
    default void
    Called when the Application is resumed from a paused state, usually when it regains focus.
    default void
    Called when the Application should update itself.
  • Method Details

    • init

      default void init()
      Called when the Application is first created. Only gets called if the application is created before the listener is added.
    • resize

      default void resize(int width, int height)
      Called when the Application is resized. This can happen at any point during a non-paused state but will never happen before a call to init().
      Parameters:
      width - the new width in pixels
      height - the new height in pixels
    • update

      default void update()
      Called when the Application should update itself.
    • pause

      default void pause()
      Called when the Application is paused, usually when it's not active or visible on screen. An Application is also paused before it is destroyed.
    • resume

      default void resume()
      Called when the Application is resumed from a paused state, usually when it regains focus.
    • dispose

      default void dispose()
      Called when the Application is destroyed. Preceded by a call to pause().
    • exit

      default void exit()
      Called when the applications exits gracefully, either through `Core.app.exit()` or through a window closing. Never called after a crash, unlike dispose().
    • fileDropped

      default void fileDropped(Fi file)
      Called when an external file is dropped into the window, e.g from the desktop.