public static void setScreen(Screen screen) { // We can only dispose if currentScreen has screen contents if (currentScreen != null) // Disposes the previous currentScreen screen contents currentScreen.dispose(); currentScreen = screen; // Creates currentScreen with contents of screen currentScreen.create(); }
public static void setScreen(Screen screen) { if (currentScreen != null) currentScreen.dispose(); currentScreen = screen; currentScreen.create(); }