Example usage for com.badlogic.gdx Screen dispose

List of usage examples for com.badlogic.gdx Screen dispose

Introduction

In this page you can find the example usage for com.badlogic.gdx Screen dispose.

Prototype

public void dispose();

Source Link

Document

Called when this screen should release all resources.

Usage

From source file:com.forerunnergames.peril.client.ui.screens.ScreenController.java

License:Open Source License

@Override
public void shutDown() {
    for (final Screen screen : screens.values()) {
        screen.dispose();
    }/*  w w  w .  j  a v  a  2s .  co m*/

    screens.clear();
}

From source file:com.quadbits.gdxhelper.LWPGame.java

License:Apache License

@Override
public void dispose() {
    // dispose current screen
    Screen screen = getScreen();
    if (screen != null) {
        screen.dispose();
    }//ww  w. j a v a 2 s .  c  o  m

    // dispose assets
    lazyAssetManager.get().dispose();

    super.dispose();
}

From source file:genuini.game.ScreenManager.java

public void showScreen(ScreenEnum screenEnum, Object... params) {

    // Get current screen to dispose it
    Screen currentScreen = game.getScreen();

    // Dispose previous screen
    if (currentScreen != null) {
        currentScreen.dispose();
    }/*from   w  w  w .  j ava  2s . c o  m*/
    // Show new screen
    AbstractScreen newScreen = screenEnum.getScreen(params);
    newScreen.buildStage();
    game.setScreen(newScreen);
}

From source file:io.piotrjastrzebski.sfg.SFGApp.java

License:Open Source License

@Override
public void setScreen(Screen screen) {
    final Screen prev = getScreen();
    super.setScreen(screen);
    if (prev != null)
        prev.dispose();
}