Libgdx:如何删除表格中的边框

时间:2016-07-10 08:58:47

标签: java android libgdx

我在表格中创建菜单按钮。 我没有指向桌子边框的任何地方,但它显示出来。 我在模拟器中运行或在桌面模式边框出现 也许我创造了错误的桌子?

@Override
    public void show() {
        table.setBounds(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());

//Button PLAY
        //скин кнопки плай
        btnplayStyle = new ImageButton.ImageButtonStyle();
        btnplayStyle.up = buttonsSkin.getDrawable("play");//кнопка не нажата
        btnplayStyle.over = buttonsSkin.getDrawable("play");
        btnplayStyle.down = buttonsSkin.getDrawable("play"); // кнопка нажата
        playSkin = new ImageButton(btnplayStyle);
        playSkin.setSize(300, 200);

        stage.addActor(playSkin);
        playSkin.addListener(new ClickListener() {
            @Override
            public void clicked(InputEvent event, float x, float y) {
                game.setScreen(new GameScreen(game));
            }
        });

        //Button score
        btnscoreStyle = new ImageButton.ImageButtonStyle();
        btnscoreStyle.up = buttonsSkin.getDrawable("records");//кнопка не нажата
        btnscoreStyle.over = buttonsSkin.getDrawable("records");
        btnscoreStyle.down = buttonsSkin.getDrawable("records"); // кнопка нажата
        scorebutton = new ImageButton(btnscoreStyle);
        scorebutton.setSize(300, 200);

        stage.addActor(scorebutton);
        scorebutton.addListener(new ClickListener() {
            @Override
            public void clicked(InputEvent event, float x, float y) {

                game.setScreen(new Score(game) {

                });

            }
        });

        //Button EXIT
        btnexitStyle = new ImageButton.ImageButtonStyle();
        btnexitStyle.up = buttonsSkin.getDrawable("exit");//кнопка не нажата
        btnexitStyle.over = buttonsSkin.getDrawable("exit");
        btnexitStyle.down = buttonsSkin.getDrawable("exit"); // кнопка нажата
        exxitbutton = new ImageButton(btnexitStyle);
        exxitbutton.setSize(300, 200);

        stage.addActor(exxitbutton);
        exxitbutton.addListener(new ClickListener() {
            @Override
            public void clicked(InputEvent event, float x, float y) {
                Gdx.app.exit();
            }
        });


        // table.add(heading);


        table.add(playSkin).width(400).height(100);
        table.getCell(playSkin).spaceBottom(30);
        table.row();


        table.add(scorebutton).width(400).height(100);

        table.getCell(scorebutton).spaceBottom(30);
        table.row();

        table.add(exxitbutton).width(400).height(100);
        table.getCell(exxitbutton).spaceBottom(30);
        table.row();
        table.debug();
        stage.addActor(table);
    }

in the emulator or in desktop mode border appears

开始按钮后会正常工作,在中间,但是每一边的边框也是因为什么而创建的

1 个答案:

答案 0 :(得分:2)

问题是你的代码最后有:

table.debug();

根据LibGDX Scene2d.ui文档 (https://github.com/libgdx/libgdx/wiki/Scene2d.ui

  

“启用表的调试行”

所以,只需删除该行代码就行了!