public class ScreenManager extends Object
GameScreen
s and Transition
s between them
NOTE: Based on Slick implementation by Kevin GlassConstructor and Description |
---|
ScreenManager()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addGameScreen(GameScreen screen)
Adds a
GameScreen to this manager |
void |
enterGameScreen(int id,
Transition transitionOut,
Transition transitionIn)
Begins a transition to a new
GameScreen |
void |
render(GameContainer gc,
Graphics g)
Renders the current
GameScreen and any Transition that may be occurring |
void |
update(GameContainer gc,
float delta)
Updates the current
GameScreen and any Transition that may be occurring |
public void update(GameContainer gc, float delta)
GameScreen
and any Transition
that may be occurringgc
- The GameContainer
that is updating this ScreenManager
delta
- The time since the last updatepublic void render(GameContainer gc, Graphics g)
GameScreen
and any Transition
that may be occurringgc
- The GameContainer
that is rendering this ScreenManager
g
- The Graphics
context available for renderingpublic void enterGameScreen(int id, Transition transitionOut, Transition transitionIn)
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(GameScreen screen)
GameScreen
to this managerscreen
- The GameScreen
to be addedCopyright © 2014. All rights reserved.