我有类 WallpaperAndDream 实现 ApplicationListener。全部由 ligdx(动态壁纸和白日梦)实现。下面是创建和渲染的方法:
public void create() {
camera = new OrthographicCamera(width, height);
camera.position.set(width / 2, height / 2, 0);
bg.setFilter(TextureFilter.Linear, TextureFilter.Linear);
batch = new SpriteBatch();
Gdx.graphics.setContinuousRendering(false);
}
public void render() {
GL10 gl = Gdx.graphics.getGL10();
gl.glClearColor(bg_red, bg_green, bg_blue, 1f);
gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
camera = new OrthographicCamera(width, height);
camera.position.set(width / 2, height / 2, 0);
camera.update();
camera.apply(Gdx.gl10);
batch.setProjectionMatrix(camera.combined);
batch.begin();
BitmapFont font;
font = new BitmapFont();
font.setScale(3.0f);
font.setColor(Color.RED);
font.draw(batch, BouncerDaydream.maxLight+" "+BouncerDaydream.thisLight, 100, 100);
batch.end();
try {
Thread.sleep(update_interval);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Gdx.graphics.requestRendering();
}
当我在动态壁纸之后有白日梦时,它会交替绘制,但我需要在这段时间内暂停(或停止)白日梦并在它可见时恢复它,我该怎么做?提前谢谢!