Class ScreenStack

java.lang.Object
tripleplay.game.ScreenStack

public class ScreenStack extends Object
Manages a stack of screens. The stack supports useful manipulations: pushing a new screen onto the stack, replacing the screen at the top of the stack with a new screen, popping a screen from the stack.

Care is taken to preserve stack invariants even in the face of errors thrown by screens when being added, removed, shown or hidden. Users can override handleError(java.lang.RuntimeException) and either simply log the error, or rethrow it if they would prefer that a screen failure render their entire screen stack unusable.

  • Field Details

    • NOOP

      public static final ScreenStack.Transition NOOP
      Simply puts the new screen in place and removes the old screen.
    • originX

      public float originX
      The x-coordinate at which screens are located. Defaults to 0.
    • originY

      public float originY
      The y-coordinate at which screens are located. Defaults to 0.
  • Constructor Details

    • ScreenStack

      public ScreenStack(Game game, GroupLayer rootLayer)
      Creates a screen stack that manages screens for game on rootLayer.
  • Method Details