Package tripleplay.game
Class ScreenStack.Transition
java.lang.Object
tripleplay.game.ScreenStack.Transition
- Direct Known Subclasses:
AbstractTransition
- Enclosing class:
ScreenStack
Implements a particular screen transition.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Direction constants, used by transitions. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
complete
(ScreenStack.Screen oscreen, ScreenStack.Screen nscreen) Called when the transition is complete.void
init
(Platform plat, ScreenStack.Screen oscreen, ScreenStack.Screen nscreen) Allows the transition to pre-compute useful values.abstract boolean
update
(ScreenStack.Screen oscreen, ScreenStack.Screen nscreen, float elapsed) Called every frame to update the transition
-
Constructor Details
-
Transition
public Transition()
-
-
Method Details
-
init
Allows the transition to pre-compute useful values. This will immediately be followed by call toupdate(tripleplay.game.ScreenStack.Screen, tripleplay.game.ScreenStack.Screen, float)
with an elapsed time of zero. -
update
public abstract boolean update(ScreenStack.Screen oscreen, ScreenStack.Screen nscreen, float elapsed) Called every frame to update the transition- Parameters:
oscreen
- the outgoing screen.nscreen
- the incoming screen.elapsed
- the elapsed time since the transition started (in millis if that's what your game is sending toScreenStack.Screen.update
).- Returns:
- false if the transition is not yet complete, true when it is complete.
-
complete
Called when the transition is complete. This is where the transition should clean up any temporary bits and restore the screens to their original state. The stack will automatically destroy/hide the old screen after calling this method. Also note that this method may be called before the transition signals completion, if a new transition is started and this transition needs be aborted.
-