Search in sources :

Example 1 with MapScreen

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);
}
Also used : MapScreen(eidolons.libgdx.screens.map.MapScreen) MapScreen(eidolons.libgdx.screens.map.MapScreen) Screen(com.badlogic.gdx.Screen)

Aggregations

Screen (com.badlogic.gdx.Screen)1 MapScreen (eidolons.libgdx.screens.map.MapScreen)1