如何在Libgdx的Screen屏幕中实现ZoomIn ZoomOut的效果

时间:2013-04-17 06:10:48

标签: java android libgdx page-zoom

我可以在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);
}

1 个答案:

答案 0 :(得分:1)

您可以使用Actions.scaleBy(amountX,amountY)或Actions.scaleTo(x,y)或Actions.sizeTo(x,y)..