2013-04-17 24 views
0

我可以在scene2D的幫助下旋轉屏幕,但我也希望當屏幕旋轉特定的時間時,我的屏幕會在libgdx中出現縮放效果。我做如下:如何使用ZoomIn縮小在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

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