Package tripleplay.game.trans
Class AbstractTransition<T extends AbstractTransition<T>>
java.lang.Object
tripleplay.game.ScreenStack.Transition
tripleplay.game.trans.AbstractTransition<T>
- Direct Known Subclasses:
InterpedTransition
public abstract class AbstractTransition<T extends AbstractTransition<T>>
extends ScreenStack.Transition
A base class for transitions that handles duration and the PITA machinery to case return values
to the right type.
-
Nested Class Summary
Nested classes/interfaces inherited from class tripleplay.game.ScreenStack.Transition
ScreenStack.Transition.Dir
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
complete
(ScreenStack.Screen oscreen, ScreenStack.Screen nscreen) Called when the transition is complete.duration
(float duration) Configures the duration of the transition.void
init
(Platform plat, ScreenStack.Screen oscreen, ScreenStack.Screen nscreen) Allows the transition to pre-compute useful values.onComplete
(Runnable action) Configures an action to be executed when this transition completes.Configures an action to be executed when this transition starts.Methods inherited from class tripleplay.game.ScreenStack.Transition
update
-
Constructor Details
-
AbstractTransition
public AbstractTransition()
-
-
Method Details
-
duration
Configures the duration of the transition. -
onStart
Configures an action to be executed when this transition starts. -
onComplete
Configures an action to be executed when this transition completes. -
init
Description copied from class:ScreenStack.Transition
Allows the transition to pre-compute useful values. This will immediately be followed by call toScreenStack.Transition.update(tripleplay.game.ScreenStack.Screen, tripleplay.game.ScreenStack.Screen, float)
with an elapsed time of zero.- Overrides:
init
in classScreenStack.Transition
-
complete
Description copied from class:ScreenStack.Transition
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.- Overrides:
complete
in classScreenStack.Transition
-