Home Game Development LibGDX Button and Table Layout

LibGDX Button and Table Layout

0
LibGDX Button and Table Layout

[ad_1]

I need to change the place of the Buttons inside a desk, I attempted setting their X and Y, or get their place when including the Buttons on the Table, but it surely did not work. It all the time aligns the button on the middle.

Code:

    TextureAtlas ta = new TextureAtlas("Comecar.txt");
    last TextureAtlas.AtlasRegion as = ta.findRegion("comeca");
    last TextureAtlas.AtlasRegion as2 = ta.findRegion("comecaversao2");
    myTexRegionDrawable2 = new TextureRegionDrawable(as2);
    myTexRegionDrawable = new TextureRegionDrawable(as);
    myTexRegionDrawable.setMinHeight(300);
    myTexRegionDrawable.setMinWidth(260);
    myTexRegionDrawable2.setMinHeight(300);
    myTexRegionDrawable2.setMinWidth(260);
    b = new PictureButton(myTexRegionDrawable);
    op = new PictureButton(myTexRegionDrawable2);
    op.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent occasion, float x, float y) {
        }
    });
    b.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent occasion, float x, float y) {
            gdxGame.setScreen(new Janela2(gdxGame));
        }
    });
    t = new Table();
    t.add(b);//I attempted setting the place right here
    t.add(op);
    t.setFillParent(true);
    stage.addActor(t);
    Gdx.enter.setInputProcessor(stage);
}

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here