use of eidolons.libgdx.screens.map.MapScreen in project Eidolons by IDemiurge.
the class GenericLauncher method switchScreen.
protected void switchScreen(Supplier<ScreenWithVideoLoader> factory, ScreenData meta) {
final ScreenWithVideoLoader newScreen = factory.get();
newScreen.initLoadingStage(meta);
newScreen.setViewPort(viewport);
newScreen.setData(meta);
final Screen oldScreen = getScreen();
setScreen(newScreen);
if (oldScreen instanceof MapScreen) {
// ?
} else {
if (oldScreen != null)
oldScreen.dispose();
}
if (newScreen instanceof MapScreen) {
try {
((MapScreen) newScreen).centerCamera();
} catch (Exception e) {
main.system.ExceptionMaster.printStackTrace(e);
}
return;
}
triggerLoaded(meta);
}