简体   繁体   中英

How to close a game that uses multiple Screen in LIbgdx

I have a class that extends Game , then a bunch of other classes that implements Screen and because of that I can just do this game.setScreen(new MyScreen(game)); but the problem is that when I do Gdx.app.exit() it just closes the current screen and go to the next one, this is the same for game.dispose() .So how do you close or exit the game when it's running as desktop or android application?

You could try doing System.exit(0) , which should work.

I believe (although I haven't tested this one out), you can also add the line: config.forceExit(false) whereas it was previously set to true.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM