我有两个TextureRegionDrawable,每个按钮一个,然后将它们添加到表中,然后添加到舞台中。问题是我尝试更改表格的高度和宽度,但是按钮变小了。图像有问题吗?
TextureAtlas ta = new TextureAtlas("Agorafunfa.txt");
final TextureAtlas.AtlasRegion as = ta.findRegion("comeca");
final TextureAtlas.AtlasRegion as2 = ta.findRegion("comecaversao2");
myTexRegionDrawable2 = new TextureRegionDrawable(as2);
myTexRegionDrawable = new TextureRegionDrawable(as);
myTexRegionDrawable.setMinWidth(260);
myTexRegionDrawable.setMinHeight(300);
myTexRegionDrawable2.setMinHeight(300);
myTexRegionDrawable2.setMinWidth(260);
b = new ImageButton(myTexRegionDrawable);
op = new ImageButton(myTexRegionDrawable2);
b.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
gdxGame.setScreen(new Janela2(gdxGame));
}
});
t = new Table();
t.row().padRight(100);
t.add(b);
t.row().padRight(100);
t.debug();
t.add(op);
t.setFillParent(true);
stage.addActor(t);
Gdx.input.setInputProcessor(stage);
}