背景を持つスクロールペインを作成しようとしています。しかし、私はバックグラウンドがスクロールペインの領域以上を占めるようにしたい。たとえば、ここに私のバックグラウンドで、赤色で、私はスクロールペインになりたいところです: Libgdx - スクロールペインの背景を大きくする
どのようにすることができます:
私はボタンを追加する場合しかし、私は次のような結果を得ます実際のスクロールペインの部分をセクションに限定します(上の図の赤色で表示されます)。
これまで私がこれまで持っていたことは次のとおりです。私は、間隔/パディングと周りのおもちゃが、それは何か良い結果を生成しませんでした:あなたがする必要がどのような
Skin skin = Resources.getSkin(Resources.SKIN_JSON);
container = new Table();
container.setSize(Resources.VIRTUAL_WIDTH, Resources.VIRTUAL_HEIGHT);
this.addActor(container);
Table table = new Table();
// table.debug();
final ScrollPane scroll = new ScrollPane(table, skin);
table.pad(10).defaults().expandX().space(4);
table.setSize(Resources.VIRTUAL_WIDTH, Resources.VIRTUAL_HEIGHT);
container.add(scroll).expand().fill().colspan(1);
container.row().space(10).padBottom(10);
Image background = new Image(Resources.getAtlas(Resources.SKIN_ATLAS).findRegion("main-panel-horz"));
container.setBackground(background.getDrawable());
TextButton button1 = new TextButton("Button1", skin);
table.add(button1);
table.row();
TextButton button2 = new TextButton("button2", skin);
table.add(button2);
table.row();
TextButton button3 = new TextButton("button3", skin);
table.add(button3);
table.row();
TextButton button4 = new TextButton("button4", skin);
table.add(button4);