1
我使用libgdx tests:uiskin.json中的皮膚。如何更改LibGdx的CheckBox圖像的大小?
由於某些原因,複選框顯示爲f.e.要小得多。 in badlogic/gdx/tests/MipMapTest.java Checkbox的大小取決於什麼?相機的分辨率?或者有沒有辦法手動設置它?
Helper.RESOLUTION_WIDTH = 800和
Helper.RESOLUTION_HEIGHT = 1280
@Override
public void show() {
skin = new Skin(Gdx.files.internal("skins/uiskin.json"));
cam = new OrthographicCamera(Helper.RESOLUTION_WIDTH, Helper.RESOLUTION_HEIGHT);
cam.position.set(Helper.RESOLUTION_WIDTH/2, Helper.RESOLUTION_HEIGHT/2, 0);
stage = new Stage(Helper.RESOLUTION_WIDTH, Helper.RESOLUTION_HEIGHT, true);
stage.setCamera(cam);
CheckBox checkBox1 = new CheckBox("", skin);
checkBox1.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
game.setScreen(new WinScreen2a(game));
}
});
CheckBox checkBox2 = new CheckBox("", skin);
checkBox2.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
game.setScreen(new WinScreen2b(game));
}
});
Window window = new Window("Dialog", skin);
window.debug();
window.setPosition(Helper.RESOLUTION_WIDTH/2 - 375, 10);
window.setSize(750, 350);
table.add(checkBox1).left();
table.getCells().get(0).size(200, 100);
table.add(option1).width(500).height(100).pad(10f);
table.row();
table.add(checkBox2).left();
table.getCells().get(2).size(200, 100);
table.add(option2).width(500).height(100).pad(10f);
table.row();
window.add(table).top().left();
stage.addActor(window);