过去 3 周我一直在使用libgdx
.. 我创建了两个引用游戏的屏幕:
public class Game extends Game {
TitleScreen titleScreen;
SplashScreen splashScreen;
@Override
public void create() {
// TODO Auto-generated method stub
titleScreen = new TitleScreen(this);
splashScreen = new SplashScreen(this);
setScreen(splashScreen);
}
}
和
public class SplashScreen implements Screen {
Game game;
public SplashScreen(Game game) {
// TODO Auto-generated constructor stub
this.game = game;
}
@Override
public void show() {
// TODO Auto-generated method stub
}
@Override
public void hide() {
// TODO Auto-generated method stub
}
@Override
public void render(float delta) {
// TODO Auto-generated method stub
Gdx.gl.glClearColor(0.5f, 1f, 1f, 1);
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
if(Gdx.input.justTouched()){
game.splashScreen.dispose();
game.setScreen(game.titlescreen);
}
}
@Override
public void resize(int width, int height) {
// TODO Auto-generated method stub
}
@Override
public void pause() {
// TODO Auto-generated method stub
}
@Override
public void resume() {
// TODO Auto-generated method stub
}
@Override
public void dispose() {
// TODO Auto-generated method stub
}
我如何splashscreen
完全处置?当我game.setscreen(game.splashscreen)
在titlescreen
课堂上打电话时,它恢复了splashscreen
;。我期待设置一个新的splashscreen
..