问题描述
我正在使用包含一个对话框作为简单菜单的阶段。它可以正常工作,但是当我尝试通过增加对话框大小来使其更大时,它的缩放比例确实很差。我该怎么办?
public Menu()
{
skin = new Skin(Gdx.files.internal("rusty-robot/skin/rusty-robot-ui.json"));
stage=new Stage();
Dialog dialog=new Dialog("Choose the number of players",skin);
Button button= new Button(skin);
dialog.setSize(630,450);
dialog.setPosition(Gdx.graphics.getWidth() / 2,Gdx.graphics.getHeight() / 2,Align.center);
final SelectBox<String> selectBox=new SelectBox<String>(skin);
selectBox.setItems("Two Players","Three Players","Four Players","Five Players","Six Players");
Game.isMenu=true;
//dialog.getContentTable().defaults().pad(10);
dialog.getContentTable().add(selectBox);
dialog.getButtonTable().add(button);
stage.addActor(dialog);
Gdx.input.setInputProcessor(stage);
...按钮侦听器..
public void draw()
{
stage.act();
Gdx.gl.glClearColor(0,0);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
stage.draw();
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)