public interface ScreenManager<T extends GameScreen> extends GameResizeListener
GameScreen
s and Transition
s between themModifier and Type | Method and Description |
---|---|
void |
addGameScreen(T screen)
Adds a
GameScreen to this manager |
void |
enterGameScreen(int id,
Transition transitionOut,
Transition transitionIn)
Begins a transition to a new
GameScreen |
T |
getGameScreen(int id)
Returns the
GameScreen with the given id |
java.util.Iterator<T> |
getGameScreens()
Returns an
Iterator over all the game screens |
void |
interpolate(GameContainer gc,
float alpha)
Interpolate between the previous and current state
|
boolean |
isTransitioning()
Returns if the
ScreenManager is moving between Screen s |
void |
onPause() |
void |
onResume() |
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 |
onResize
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 updatevoid interpolate(GameContainer gc, float alpha)
alpha
- The interpolation alpha valuevoid 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 renderingvoid onPause()
void onResume()
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 invoid addGameScreen(T screen)
GameScreen
to this managerscreen
- The GameScreen
to be addedT getGameScreen(int id)
GameScreen
with the given idid
- The id to search forGameScreen
registered with this
managerboolean isTransitioning()
ScreenManager
is moving between Screen
sTransition
s activejava.util.Iterator<T> getGameScreens()
Iterator
over all the game screens