Artenus 2D Framework
Artenus Reference
Interface for classes that handle stage events. This is one of the key interfaces that must be implemented in any game that uses this framework. It is the companion of Stage and handles basic functionality for the game. You can assign a StageManager to your stage using setManager. Failing to provide a stage manager will cause your application to crash with an IllegalStateException when it tries to load the first scene.

See Also:

public interface StageManager

Method Summary

Modifier and TypeMethod and Description
public ScenecreateInitialScene(Stage stage)
Creates the initial scene for the stage.
public voidonEvent(Stage stage, StageEvents event)
Invoked by the framework whenever an external event is triggered.
public voidonLoadStage(Stage stage)
Called by the framework to load the required global resources for the stage.

Method Detail

createInitialScene
public Scene createInitialScene(
    Stage stage
)
Creates the initial scene for the stage. It will be the first scene that is displayed on the stage after the Artenus logo splash and the loading scene. It can be a splash screen or the main menu scene of the game. When creating the initial scene, you should NOT add it to the stage manually. This will be done later automatically in the framework.
Parameters:
stageThe stage that the new scene belongs to
Returns:
The first scene of the game
See Also:
onEvent
public void onEvent(
    Stage stage,
    StageEvents event
)
Invoked by the framework whenever an external event is triggered. This event can be one of "pause", "resume" or "display".
Parameters:
stageStage for which the event has occurred
eventThe event
onLoadStage
public void onLoadStage(
    Stage stage
)
Called by the framework to load the required global resources for the stage. The "loading" logic of the game should be implemented in this method. Note that displaying a loading screen is handled automatically and all the game developer needs to do is to load resources here.
Parameters:
stageThe stage for which the resources are going to be loaded.
See Also: