Package tripleplay.game
Class ScreenSpace.Dir
java.lang.Object
tripleplay.game.ScreenSpace.Dir
- All Implemented Interfaces:
Cloneable
- Enclosing class:
ScreenSpace
The directions in which a new screen can be added.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether this direction can be manually "untransitioned".void
finish
(ScreenSpace.Screen oscreen, ScreenSpace.Screen nscreen) Cleans up after a transition.int
Returns the horizontal motion of this direction: 1, 0 or -1.void
init
(ScreenSpace.Screen oscreen, ScreenSpace.Screen nscreen) Preparesoscreen
andnscreen
to be transitioned.float
Returns the duration of this transition (in millis).abstract ScreenSpace.Dir
Returns the direction to use when untransing from this dir.abstract void
update
(ScreenSpace.Screen oscreen, ScreenSpace.Screen nscreen, float pct) Updates the position ofoscreen
andnscreen
based onpct
.int
vertComp()
Returns the vertical motion of this direction: 1, 0 or -1.
-
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
Returns the direction to use when untransing from this dir. -
init
Preparesoscreen
andnscreen
to be transitioned.oscreen
is the currently visible screen andnscreen
is the screen transitioning into view. -
update
Updates the position ofoscreen
andnscreen
based onpct
.- Parameters:
pct
- a value ranged[0,1]
indicating degree of completeness.
-
finish
Cleans up after a transition.update(tripleplay.game.ScreenSpace.Screen,tripleplay.game.ScreenSpace.Screen,float)
will have been called withpct
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).
-