Class ScreenStack.Screen

java.lang.Object
tripleplay.game.ScreenStack.Screen
Direct Known Subclasses:
ScreenStack.UIScreen
Enclosing class:
ScreenStack

public abstract static class ScreenStack.Screen extends Object
Displays and manages the lifecycle for a single game screen.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    The layer on which all of this screen's UI must be placed.
    final react.Signal<Clock>
    A signal emitted on every frame, while this screen is showing.
    final react.Signal<Clock>
    A signal emitted on every simulation update, while this screen is showing.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds ac to a set to be closed when this screen is hidden.
    Returns a reference to the game in which this screen is operating.
    void
    Called when this screen's transition out of view has started.
    void
    Called when this screen's transition into view has completed.
    pythagoras.f.IDimension
    Returns the size of this screen.
    react.ValueView<pythagoras.f.IDimension>
    The size of this screen as a reactive value.
    void
    Called when a screen is added to the screen stack for the first time.
    void
    Called when a screen is no longer the top screen (having either been pushed down by another screen, or popped off the stack).
    void
    Called when a screen has been removed from the stack.
    void
    Called when a screen becomes the top screen, and is therefore made visible.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • layer

      public final GroupLayer layer
      The layer on which all of this screen's UI must be placed.
    • update

      public final react.Signal<Clock> update
      A signal emitted on every simulation update, while this screen is showing.
    • paint

      public final react.Signal<Clock> paint
      A signal emitted on every frame, while this screen is showing.
  • Method Details

    • game

      public Game game()
      Returns a reference to the game in which this screen is operating.
    • size

      public pythagoras.f.IDimension size()
      Returns the size of this screen. This is used for transitions. Defaults to the size of the entire view.
    • sizeValue

      public react.ValueView<pythagoras.f.IDimension> sizeValue()
      The size of this screen as a reactive value. Listeners are notified when the screen size changes.
    • wasAdded

      public void wasAdded()
      Called when a screen is added to the screen stack for the first time.
    • wasShown

      public void wasShown()
      Called when a screen becomes the top screen, and is therefore made visible.
    • wasHidden

      public void wasHidden()
      Called when a screen is no longer the top screen (having either been pushed down by another screen, or popped off the stack).
    • wasRemoved

      public void wasRemoved()
      Called when a screen has been removed from the stack. This will always be preceeded by a call to wasHidden(), though not always immediately.
    • showTransitionCompleted

      public void showTransitionCompleted()
      Called when this screen's transition into view has completed. wasShown() is called immediately before the transition begins, and this method is called when it ends.
    • hideTransitionStarted

      public void hideTransitionStarted()
      Called when this screen's transition out of view has started. wasHidden() is called when the hide transition completes.
    • closeOnHide

      public void closeOnHide(AutoCloseable ac)
      Adds ac to a set to be closed when this screen is hidden.