Package tripleplay.game.trans
Class PageTurnTransition
java.lang.Object
tripleplay.game.ScreenStack.Transition
tripleplay.game.trans.AbstractTransition<T>
tripleplay.game.trans.InterpedTransition<PageTurnTransition>
tripleplay.game.trans.PageTurnTransition
Opens the current screen like the page of a book, revealing the new screen beneath.
-
Nested Class Summary
Nested classes/interfaces inherited from class tripleplay.game.ScreenStack.Transition
ScreenStack.Transition.Dir
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclose()
Reverses this transition, making it a page close instead of open.void
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.boolean
update
(ScreenStack.Screen oscreen, ScreenStack.Screen nscreen, float elapsed) Called every frame to update the transitionMethods inherited from class tripleplay.game.trans.InterpedTransition
easeIn, easeInOut, easeOut, interp, linear
Methods inherited from class tripleplay.game.trans.AbstractTransition
duration, onComplete, onStart
-
Constructor Details
-
PageTurnTransition
public PageTurnTransition()
-
-
Method Details
-
close
Reverses this transition, making it a page close instead of open. Note that this changes the interpolator, so if you want a custom interpolator, configure it after calling this method. -
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 classAbstractTransition<PageTurnTransition>
-
update
Description copied from class:ScreenStack.Transition
Called every frame to update the transition- Specified by:
update
in classScreenStack.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
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 classAbstractTransition<PageTurnTransition>
-