Artenus 2D Framework
Artenus Reference
Represents the stage. This interface is one of the key components of this framework. The stage is where everything actually happens. Each game has a stage on which different scenes appear. Its instance is passed to the application through init. The application needs to assign a StageManager to the stage in order to handle its important event.

See Also:

public interface Stage

Method Summary

Modifier and TypeMethod and Description
public voidaddFilter(PostProcessingFilter filter)
Adds a post-processing filter to the rendering pipeline.
public floatgetLogicalHeight()
Gets the logical height of the stage.
public floatgetLogicalWidth()
Gets the logical width of the stage.
public StageManagergetManager()
Gets the currently assigned stage manager.
public ScenegetScene()
Gets the current scene.
public floatlogicalToScreenX(float x)
Converts stage x to screen x coordination using the scaling factor.
public floatlogicalToScreenY(float y)
Converts stage y to screen y coordination using the scaling factor.
public voidremoveFilter(PostProcessingFilter filter)
Removes a post-processing filter from the rendering pipeline.
public floatscreenToLogicalX(float x)
Converts screen x to stage x coordination using the scaling factor.
public floatscreenToLogicalY(float y)
Converts screen y to stage x coordination using the scaling factor.
public voidsetLoadingBackColor(RGB bgColor)
Sets the background color of the loading screen.
public voidsetManager(StageManager stageManager)
Sets the stage manager responsible for handling required functionality for this Stage.
public voidsetScene(Scene scene)
Sets the next scene that should be shown on this Stage.

Method Detail

addFilter
public void addFilter(
    PostProcessingFilter filter
)
Adds a post-processing filter to the rendering pipeline. Filters will be applied in the order they are added to the stage.
Parameters:
filterThe filter to be added
getLogicalHeight
public float getLogicalHeight()
Gets the logical height of the stage. If the device is in landscape mode, this value is always 600 and otherwise it is the scaled version of screen height to match the width of 600.
Returns:
Logical height in texels
getLogicalWidth
public float getLogicalWidth()
Gets the logical width of the stage. If the device is in portrait mode, this value is always 600 and otherwise it is the scaled version of screen width to match the height of 600.
Returns:
Logical width in texels
getManager
public StageManager getManager()
Gets the currently assigned stage manager. A stage manager handles basic events and functionality for this Stage.
Returns:
The stage manager for this stage
getScene
public Scene getScene()
Gets the current scene. If a new scene has been set, but the transition is not yet complete, previous scene might be returned.
Returns:
The current scene
logicalToScreenX
public float logicalToScreenX(
    float x
)
Converts stage x to screen x coordination using the scaling factor.
Parameters:
xStage x
Returns:
Screen x
logicalToScreenY
public float logicalToScreenY(
    float y
)
Converts stage y to screen y coordination using the scaling factor.
Parameters:
yStage y
Returns:
Screen y
removeFilter
public void removeFilter(
    PostProcessingFilter filter
)
Removes a post-processing filter from the rendering pipeline.
Parameters:
filterThe filter to be removed
screenToLogicalX
public float screenToLogicalX(
    float x
)
Converts screen x to stage x coordination using the scaling factor.
Parameters:
xScreen x
Returns:
Stage x
screenToLogicalY
public float screenToLogicalY(
    float y
)
Converts screen y to stage x coordination using the scaling factor.
Parameters:
yScreen y
Returns:
Stage y
setLoadingBackColor
public void setLoadingBackColor(
    RGB bgColor
)
Sets the background color of the loading screen.
Parameters:
bgColorBackground color
setManager
public void setManager(
    StageManager stageManager
)
Sets the stage manager responsible for handling required functionality for this Stage. You MUST assign a stage manager before doing anything else with this Stage.
Parameters:
stageManagerThe stage manager
setScene
public void setScene(
    Scene scene
)
Sets the next scene that should be shown on this Stage. The scene will not be shown immediately and will go through a transition effect and possibly a local loading procedure.
Parameters:
sceneThe new scene