raeleus / skin-composer

Create skins for LibGDX scene2d.ui with a graphical interface.
MIT License
431 stars 35 forks source link

Wrong java code generated by SplitPane in scene composer #118

Closed LyricSeraph closed 2 years ago

LyricSeraph commented 2 years ago

Version: 46

Code generated with SplitPane will duplicate the first pane part twice and miss the second pane.

See example below:

UI display on scene composer:

QQ20220219-191408@2x

Code generated:

// impots...
public class Core extends ApplicationAdapter {
    private Skin skin;

    private Stage stage;

    public void create() {
        stage = new Stage(new ScreenViewport());
        skin = new Skin(Gdx.files.internal("skin.json"));
        Gdx.input.setInputProcessor(stage);

        Table table = new Table();
        table.setFillParent(true);

        Label label = new Label("first pane", skin);

        label = new Label("first pane", skin);
        SplitPane splitPane = new SplitPane(label, label, false, skin);
        table.add(splitPane);
        stage.addActor(table);
    }

    // remaining codes
}
LyricSeraph commented 2 years ago

It looks a wrong child is passed on this line:

https://github.com/raeleus/skin-composer/blob/33e33c97385009eadc99b5de609a3347c0208897/core/src/com/ray3k/skincomposer/dialog/scenecomposer/DialogSceneComposerJavaBuilder.java#L937

raeleus commented 2 years ago

Oh my! What a big screw up. I'll make an update soon. Thanks for your research on this.