public class ScreenManager extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ScreenManager.TransactionType
Available screen transitions effects.
|
| Modifier and Type | Field and Description |
|---|---|
protected int |
activeScreen |
protected SpriteBatch |
batch |
protected FrameBuffer |
currFbo |
protected RenderingScreen |
currScreen |
protected FrameBuffer |
nextFbo |
protected RenderingScreen |
nextScreen |
protected int |
nextScreenIdx |
protected ArrayList<Class> |
screens |
protected ScreenTransition |
screenTransition |
protected float |
time |
protected boolean |
transitioning |
protected ScreenManager.TransactionType |
transitionStyle |
| Constructor and Description |
|---|
ScreenManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
activateNextScreen()
Called to activate the next screen without transition
|
void |
activateScreen(int nextScreen)
Show the corresponding screen without transition.
|
protected RenderingScreen |
createInstance(Class c) |
RenderingScreen |
getActiveScreen() |
void |
registerScreen(Class s)
Add a screen to the screen list
|
void |
render(GdxGraphics g)
Render the current screen to the GdxGraphics
|
void |
sliceTransitionToNext()
Called to transition to the next screen with slicing.
|
void |
slideTransitionToNext()
Called to transition to the next screen with sliding.
|
void |
smoothTransitionToNext()
Called to transition to the next screen with fade-out.
|
void |
transitionTo(int nextScreen,
ScreenManager.TransactionType effect)
Called to transition to the specified screen with the corresponding effect.
|
void |
transitionToNext(ScreenManager.TransactionType effect)
Called to transition to the next screen with the corresponding effect.
|
protected int activeScreen
protected RenderingScreen currScreen
protected RenderingScreen nextScreen
protected ScreenManager.TransactionType transitionStyle
protected FrameBuffer currFbo
protected FrameBuffer nextFbo
protected SpriteBatch batch
protected float time
protected ScreenTransition screenTransition
protected boolean transitioning
protected int nextScreenIdx
protected RenderingScreen createInstance(Class c)
public void render(GdxGraphics g)
g - The instance of GdxGraphics to draw onpublic void registerScreen(Class s)
s - The class of the screen to addpublic void activateNextScreen()
public void activateScreen(int nextScreen)
nextScreen - the screen index to displaypublic void transitionToNext(ScreenManager.TransactionType effect)
effect - the screen transition effect to usepublic void transitionTo(int nextScreen,
ScreenManager.TransactionType effect)
nextScreen - the screen index to displayeffect - the screen transition effect to usepublic void sliceTransitionToNext()
ScreenManager.TransactionType.SLICE effect.transitionToNext(TransactionType)public void slideTransitionToNext()
ScreenManager.TransactionType.SLIDE effect.transitionToNext(TransactionType)public void smoothTransitionToNext()
ScreenManager.TransactionType.SMOOTH effect.transitionToNext(TransactionType)public RenderingScreen getActiveScreen()
null is a transition is in progressCopyright © 2014-2016 gdx2d - https://github.com/hevs-isi/gdx2d