public class ScreenManagerSystem extends GameSystem<GameScreenEntity> implements ScreenManager<GameScreenEntity>
ScreenManager as a System suitable for
the Entity-Component-System architecture| Modifier and Type | Field and Description |
|---|---|
protected GameScreenEntity |
currentScreen |
protected GameScreenEntity |
nextScreen |
protected Transition |
transitionIn |
protected Transition |
transitionOut |
| Constructor and Description |
|---|
ScreenManagerSystem() |
| Modifier and Type | Method and Description |
|---|---|
void |
addGameScreen(GameScreenEntity screen)
Interface implementation.
|
void |
enterGameScreen(int id,
Transition transitionOut,
Transition transitionIn)
Begins a transition to a new
GameScreen |
GameScreenEntity |
getGameScreen(int id)
Returns the
GameScreen with the given id |
void |
initialise(GameContainer gc)
Initialise the
System |
void |
interpolate(GameContainer gc,
float alpha)
Interpolate the
System |
boolean |
isDebugging()
Returns if this
System is debugging |
boolean |
isTransitioning()
Returns if the
ScreenManager is moving between Screens |
void |
render(GameContainer gc,
Graphics g)
Render the
System |
void |
setDebugging(boolean debugging)
Sets whether or not this
System is in debug mode |
void |
update(GameContainer gc,
float delta)
Update the
System |
updateaddEntity, getEntity, removeEntityprotected GameScreenEntity currentScreen
protected GameScreenEntity nextScreen
protected Transition transitionIn
protected Transition transitionOut
public void initialise(GameContainer gc)
GameSystemSysteminitialise in class GameSystem<GameScreenEntity>gc - The GameContainer calling initialisepublic void update(GameContainer gc, float delta)
GameSystemSystemupdate in interface ScreenManager<GameScreenEntity>update in class GameSystem<GameScreenEntity>gc - The GameContainer calling updatedelta - The time in seconds since the last updatepublic void interpolate(GameContainer gc, float alpha)
GameSystemSysteminterpolate in interface ScreenManager<GameScreenEntity>interpolate in class GameSystem<GameScreenEntity>gc - The GameContainer calling interpolatealpha - The alpha value to use during interpolationpublic void render(GameContainer gc, Graphics g)
GameSystemSystemrender in interface ScreenManager<GameScreenEntity>render in class GameSystem<GameScreenEntity>gc - The GameContainer calling renderg - The Graphics instancepublic boolean isDebugging()
SystemSystem is debuggingisDebugging in class System<GameScreenEntity>public void setDebugging(boolean debugging)
SystemSystem is in debug modesetDebugging in class System<GameScreenEntity>debugging - True if debuggingpublic void enterGameScreen(int id,
Transition transitionOut,
Transition transitionIn)
ScreenManagerGameScreenenterGameScreen in interface ScreenManager<GameScreenEntity>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(GameScreenEntity screen)
addGameScreen in interface ScreenManager<GameScreenEntity>screen - The GameScreen to be addedpublic GameScreenEntity getGameScreen(int id)
ScreenManagerGameScreen with the given idgetGameScreen in interface ScreenManager<GameScreenEntity>id - The id to search forGameScreen registered with this
managerpublic boolean isTransitioning()
ScreenManagerScreenManager is moving between ScreensisTransitioning in interface ScreenManager<GameScreenEntity>Transitions active