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 TypeMethodDescriptiondefault void
dispose()
Called when theApplication
is destroyed.default void
exit()
Called when the applications exits gracefully, either through `Core.app.exit()` or through a window closing.default void
fileDropped
(Fi file) Called when an external file is dropped into the window, e.g from the desktop.default void
init()
Called when theApplication
is first created.default void
pause()
Called when theApplication
is paused, usually when it's not active or visible on screen.default void
resize
(int width, int height) Called when theApplication
is resized.default void
resume()
Called when theApplication
is resumed from a paused state, usually when it regains focus.default void
update()
Called when theApplication
should update itself.
-
Method Details
-
init
default void init()Called when theApplication
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 theApplication
is 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 theApplication
should update itself. -
pause
default void pause()Called when theApplication
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 theApplication
is resumed from a paused state, usually when it regains focus. -
dispose
default void dispose()Called when theApplication
is 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.
-