Class ScreenSpace.Dir

java.lang.Object
tripleplay.game.ScreenSpace.Dir
All Implemented Interfaces:
Cloneable
Enclosing class:
ScreenSpace

public abstract static class ScreenSpace.Dir extends Object implements Cloneable
The directions in which a new screen can be added.
  • Constructor Details

    • Dir

      public Dir()
  • Method Details

    • horizComp

      public int horizComp()
      Returns the horizontal motion of this direction: 1, 0 or -1.
    • vertComp

      public int vertComp()
      Returns the vertical motion of this direction: 1, 0 or -1.
    • canUntrans

      public boolean canUntrans()
      Returns whether this direction can be manually "untransitioned".
    • untransDir

      public abstract ScreenSpace.Dir untransDir()
      Returns the direction to use when untransing from this dir.
    • init

      public void init(ScreenSpace.Screen oscreen, ScreenSpace.Screen nscreen)
      Prepares oscreen and nscreen to be transitioned. oscreen is the currently visible screen and nscreen is the screen transitioning into view.
    • update

      public abstract void update(ScreenSpace.Screen oscreen, ScreenSpace.Screen nscreen, float pct)
      Updates the position of oscreen and nscreen based on pct.
      Parameters:
      pct - a value ranged [0,1] indicating degree of completeness.
    • finish

      public void finish(ScreenSpace.Screen oscreen, ScreenSpace.Screen nscreen)
      Cleans up after a transition. update(tripleplay.game.ScreenSpace.Screen,tripleplay.game.ScreenSpace.Screen,float) will have been called with pct equal to one immediately prior to this call, so this method is only needed when actual cleanup is needed, like the removal of custom shaders, etc.

      Note also that the old screen's layer will have been made non-visible prior to this call. This call should not restore that visibility.

    • transitionTime

      public float transitionTime()
      Returns the duration of this transition (in millis).