如何在libgdx中更改图像?

时间:2014-05-23 14:42:54

标签: image libgdx textures

我通过纹理加载图像

texture = new Texture("badlogic.jpg");
texture2 = new Texture("badlogic2.png");
image=new Image(texture);
stage.addActor(image);

或TextureRegion

texture = new Texture("badlogic.jpg");
regions=new TextureRegion[2];
regions[0]=new TextureRegion(texture, 0, 0, 64, 64);
regions[1]=new TextureRegion(texture, 0, 63, 64, 64);
image=new Image(regions[0]);
stage.addActor(image);

现在,我想将image更改为texture2regions[1]。我怎么能这样做?

0 个答案:

没有答案