public void setCurrentScreen(final Screen screen) { if (screen != null) { this.isInstance = false; if (currentControl != null) { currentControl.destroy(); } this.currentControl = screen; currentControl.setLock(false); currentControl.setLocation(0, 0); currentControl.setClose(false); currentControl.setOnLoadState(true); if (screen.getBackground() != null) { currentControl.setRepaintMode(Screen.SCREEN_BITMAP_REPAINT); } this.isInstance = true; if (screen instanceof EmulatorListener) { setEmulatorListener((EmulatorListener) screen); } else { setEmulatorListener(null); } this.screens.add(screen); } }
public LTexture getBackground() { if (isInstance) { return currentControl.getBackground(); } return null; }