Package arc
Interface ApplicationListener
- All Known Implementing Classes:
ApplicationCore
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 TypeMethodDescriptiondefault voiddispose()Called when theApplicationis destroyed.default voidexit()Called when the applications exits gracefully, either through `Core.app.exit()` or through a window closing.default voidfileDropped(Fi file) Called when an external file is dropped into the window, e.g from the desktop.default voidinit()Called when theApplicationis first created.default voidpause()Called when theApplicationis paused, usually when it's not active or visible on screen.default voidresize(int width, int height) Called when theApplicationis resized.default voidresume()Called when theApplicationis resumed from a paused state, usually when it regains focus.default voidupdate()Called when theApplicationshould update itself.
-
Method Details
-
init
default void init()Called when theApplicationis 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 theApplicationis resized. This can happen at any point during a non-paused state but will never happen before a call toinit().- Parameters:
width- the new width in pixelsheight- the new height in pixels
-
update
default void update()Called when theApplicationshould update itself. -
pause
default void pause()Called when theApplicationis 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 theApplicationis resumed from a paused state, usually when it regains focus. -
dispose
default void dispose()Called when theApplicationis destroyed. Preceded by a call topause(). -
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
Called when an external file is dropped into the window, e.g from the desktop.
-