我可以在scene2D的帮助下旋转屏幕,但我也希望当屏幕旋转特定持续时间时,我的屏幕在libgdx中出现缩小效果。我这样做如下:
private Stage stage;
在更新方法中
Gdx.gl.glClearColor(1, 1, 1, 1);
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
batch.setProjectionMatrix(camera.combined);
stage.act(delta);
stage.draw();
@Override
public void show() {
stage = new Stage();
Gdx.input.setInputProcessor(stage);
Image splashImage = new Image(region);
splashImage.addAction(Actions.sequence(Actions.moveTo(0,10, 0.5f),
//move actor to 200,200
Actions.rotateTo(360, 1f), //rotate actor to 90°
Actions.fadeOut(0.5f), //fade out actor (change alpha to 0)
Actions.removeActor()));
stage.addActor(splashImage);
}