public class BasicScreenManager<T extends GameScreen> extends java.lang.Object implements ScreenManager<T>
| Modifier and Type | Field and Description | 
|---|---|
| protected T | currentScreen | 
| protected T | nextScreen | 
| protected Transition | transitionIn | 
| protected Transition | transitionOut | 
| Constructor and Description | 
|---|
| BasicScreenManager() | 
| Modifier and Type | Method and Description | 
|---|---|
| void | addGameScreen(T screen)Adds a  GameScreento this manager | 
| void | enterGameScreen(int id,
               Transition transitionOut,
               Transition transitionIn)Begins a transition to a new  GameScreen | 
| T | getGameScreen(int id)Returns the  GameScreenwith the given id | 
| java.util.Iterator<T> | getGameScreens()Returns an  Iteratorover all the game screens | 
| void | interpolate(GameContainer gc,
           float alpha)Interpolate between the previous and current state | 
| boolean | isTransitioning()Returns if the  ScreenManageris moving betweenScreens | 
| void | onPause() | 
| void | onResize(int width,
        int height) | 
| void | onResume() | 
| void | render(GameContainer gc,
      Graphics g)Renders the current  GameScreenand anyTransitionthat
 may be occurring | 
| void | update(GameContainer gc,
      float delta)Updates the current  GameScreenand anyTransitionthat
 may be occurring | 
protected T extends GameScreen currentScreen
protected T extends GameScreen nextScreen
protected Transition transitionIn
protected Transition transitionOut
public void update(GameContainer gc, float delta)
ScreenManagerGameScreen and any Transition that
 may be occurringupdate in interface ScreenManager<T extends GameScreen>gc - The GameContainer that is updating this
            ScreenManagerdelta - The time since the last updatepublic void interpolate(GameContainer gc, float alpha)
ScreenManagerinterpolate in interface ScreenManager<T extends GameScreen>alpha - The interpolation alpha valuepublic void render(GameContainer gc, Graphics g)
ScreenManagerGameScreen and any Transition that
 may be occurringrender in interface ScreenManager<T extends GameScreen>gc - The GameContainer that is rendering this
            ScreenManagerg - The Graphics context available for renderingpublic void enterGameScreen(int id,
                            Transition transitionOut,
                            Transition transitionIn)
ScreenManagerGameScreenenterGameScreen in interface ScreenManager<T extends GameScreen>id - The id of the GameScreen to transition totransitionOut - The outgoing Transition, e.g. fade outtransitionIn - The incoming Transition, e.g. fade inpublic void addGameScreen(T screen)
ScreenManagerGameScreen to this manageraddGameScreen in interface ScreenManager<T extends GameScreen>screen - The GameScreen to be addedpublic T getGameScreen(int id)
ScreenManagerGameScreen with the given idgetGameScreen in interface ScreenManager<T extends GameScreen>id - The id to search forGameScreen registered with this
         managerpublic boolean isTransitioning()
ScreenManagerScreenManager is moving between ScreensisTransitioning in interface ScreenManager<T extends GameScreen>Transitions activepublic void onResize(int width,
                     int height)
onResize in interface GameResizeListenerpublic void onPause()
onPause in interface ScreenManager<T extends GameScreen>public void onResume()
onResume in interface ScreenManager<T extends GameScreen>public java.util.Iterator<T> getGameScreens()
ScreenManagerIterator over all the game screensgetGameScreens in interface ScreenManager<T extends GameScreen>