Search in sources :

Example 66 with ChangeListener

use of com.badlogic.gdx.scenes.scene2d.utils.ChangeListener in project gdx-skineditor by cobolfoo.

the class DrawablePickerDialog method updateTable.

/**
 */
public void updateTable() {
    tableDrawables.clear();
    Iterator<String> keys = items.keys().iterator();
    int count = 0;
    while (keys.hasNext()) {
        final String key = keys.next();
        if (key.startsWith("widgets/")) {
            continue;
        }
        Button buttonItem = new Button(game.skin);
        Image img = null;
        if (items.get(key) instanceof Drawable) {
            img = new Image((Drawable) items.get(key));
        } else {
            img = new Image((TextureRegion) items.get(key));
        }
        if (zoom == true) {
            buttonItem.add(img).expand().fill().pad(5);
        } else {
            buttonItem.add(img).expand().pad(5);
        }
        buttonItem.addListener(new ChangeListener() {

            @Override
            public void changed(ChangeEvent event, Actor actor) {
                if (field == null) {
                    return;
                }
                try {
                    // game.screenMain.paneOptions.refreshSelection();
                    if (items.get(key) instanceof Drawable) {
                        field.set(game.screenMain.paneOptions.currentStyle, items.get(key));
                    } else {
                        boolean ninepatch = false;
                        FileHandle test = new FileHandle("projects/" + game.screenMain.getcurrentProject() + "/assets/" + key + ".9.png");
                        if (test.exists() == true) {
                            ninepatch = true;
                        }
                        if (ninepatch == true) {
                            game.skinProject.add(key, new NinePatchDrawable(new NinePatch((TextureRegion) items.get(key))));
                            field.set(game.screenMain.paneOptions.currentStyle, game.skinProject.getDrawable(key));
                        } else {
                            game.skinProject.add(key, new SpriteDrawable(new Sprite((TextureRegion) items.get(key))));
                            field.set(game.screenMain.paneOptions.currentStyle, game.skinProject.getDrawable(key));
                        }
                    }
                    game.screenMain.saveToSkin();
                    hide();
                    game.screenMain.panePreview.refresh();
                    game.screenMain.paneOptions.updateSelectedTableFields();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
        String objectType = items.get(key).getClass().getSimpleName();
        objectType = objectType.replace("Drawable", "");
        buttonItem.row();
        buttonItem.add(new Label(key, game.skin));
        buttonItem.row();
        buttonItem.add(new Label(objectType, game.skin, "title"));
        buttonItem.row();
        buttonItem.setClip(true);
        tableDrawables.add(buttonItem).width(160).height(184).pad(5);
        if (count == 4) {
            count = 0;
            tableDrawables.row();
            continue;
        }
        count++;
    }
}
Also used : SpriteDrawable(com.badlogic.gdx.scenes.scene2d.utils.SpriteDrawable) Sprite(com.badlogic.gdx.graphics.g2d.Sprite) FileHandle(com.badlogic.gdx.files.FileHandle) NinePatch(com.badlogic.gdx.graphics.g2d.NinePatch) Drawable(com.badlogic.gdx.scenes.scene2d.utils.Drawable) SpriteDrawable(com.badlogic.gdx.scenes.scene2d.utils.SpriteDrawable) NinePatchDrawable(com.badlogic.gdx.scenes.scene2d.utils.NinePatchDrawable) Label(com.badlogic.gdx.scenes.scene2d.ui.Label) Image(com.badlogic.gdx.scenes.scene2d.ui.Image) TextureRegion(com.badlogic.gdx.graphics.g2d.TextureRegion) ChangeEvent(com.badlogic.gdx.scenes.scene2d.utils.ChangeListener.ChangeEvent) TextButton(com.badlogic.gdx.scenes.scene2d.ui.TextButton) Button(com.badlogic.gdx.scenes.scene2d.ui.Button) ImageButton(com.badlogic.gdx.scenes.scene2d.ui.ImageButton) Actor(com.badlogic.gdx.scenes.scene2d.Actor) ChangeListener(com.badlogic.gdx.scenes.scene2d.utils.ChangeListener) NinePatchDrawable(com.badlogic.gdx.scenes.scene2d.utils.NinePatchDrawable)

Example 67 with ChangeListener

use of com.badlogic.gdx.scenes.scene2d.utils.ChangeListener in project gdx-skineditor by cobolfoo.

the class FontPickerDialog method updateTable.

/**
 */
public void updateTable() {
    fonts = game.skinProject.getAll(BitmapFont.class);
    tableFonts.clear();
    tableFonts.add(new Label("Font Name", game.skin, "title")).left().width(170);
    tableFonts.add(new Label("Value", game.skin, "title")).colspan(3).left().width(60).padRight(50).expandX().fillX();
    tableFonts.row();
    Iterator<String> it = fonts.keys().iterator();
    while (it.hasNext()) {
        final String key = it.next();
        final BitmapFont font = fonts.get(key);
        tableFonts.add(key).left();
        Label.LabelStyle labelStyle = new Label.LabelStyle();
        labelStyle.font = font;
        labelStyle.fontColor = Color.WHITE;
        tableFonts.add(new Label("Sample Text", labelStyle)).left();
        TextButton buttonSelect = new TextButton("Select", game.skin);
        buttonSelect.addListener(new ChangeListener() {

            @Override
            public void changed(ChangeEvent event, Actor actor) {
                try {
                    // Since we have reloaded everything we have to get
                    // field back
                    game.screenMain.paneOptions.refreshSelection();
                    field.set(game.screenMain.paneOptions.currentStyle, font);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                hide();
                game.screenMain.panePreview.refresh();
                game.screenMain.paneOptions.updateSelectedTableFields();
                game.screenMain.saveToSkin();
            }
        });
        TextButton buttonRemove = new TextButton("Remove", game.skin);
        buttonRemove.addListener(new ChangeListener() {

            @Override
            public void changed(ChangeEvent event, Actor actor) {
                Dialog dlg = new Dialog("Delete Font", game.skin) {

                    @Override
                    protected void result(Object object) {
                        if ((Boolean) object == false) {
                            return;
                        }
                        if (isFontInUse(font) == true) {
                            game.showNotice("Error", "Bitmap font already in use!", getStage());
                        } else {
                            // Remove files from disk (fnt and png)
                            FileHandle targetFont = new FileHandle("projects/" + game.screenMain.getcurrentProject() + "/" + key + ".fnt");
                            FileHandle targetImage = new FileHandle("projects/" + game.screenMain.getcurrentProject() + "/assets/" + key + ".png");
                            targetFont.delete();
                            targetImage.delete();
                            fonts.remove(key);
                            // update table
                            updateTable();
                            game.screenMain.saveToSkin();
                        }
                    }
                };
                dlg.pad(20);
                dlg.getContentTable().add("You are sure you want to delete this bitmap font?");
                dlg.button("OK", true);
                dlg.button("Cancel", false);
                dlg.key(com.badlogic.gdx.Input.Keys.ENTER, true);
                dlg.key(com.badlogic.gdx.Input.Keys.ESCAPE, false);
                dlg.show(getStage());
            }
        });
        if (field != null) {
            tableFonts.add(buttonSelect).left();
        }
        tableFonts.add(buttonRemove).left().expandX();
        tableFonts.row();
    }
}
Also used : TextButton(com.badlogic.gdx.scenes.scene2d.ui.TextButton) FileHandle(com.badlogic.gdx.files.FileHandle) Label(com.badlogic.gdx.scenes.scene2d.ui.Label) Dialog(com.badlogic.gdx.scenes.scene2d.ui.Dialog) Actor(com.badlogic.gdx.scenes.scene2d.Actor) ChangeListener(com.badlogic.gdx.scenes.scene2d.utils.ChangeListener) BitmapFont(com.badlogic.gdx.graphics.g2d.BitmapFont)

Example 68 with ChangeListener

use of com.badlogic.gdx.scenes.scene2d.utils.ChangeListener in project gdx-skineditor by cobolfoo.

the class OptionsPane method updateTableFields.

/**
 */
private void updateTableFields(final String style) {
    ImageButton button = (ImageButton) game.screenMain.barWidgets.group.getChecked();
    String widget = button.getUserObject().toString();
    Gdx.app.log("OptionsPane", "Update fields table for widget: " + widget + ", style: " + style);
    tableFields.clear();
    tableFields.add(new Label("Name", game.skin, "title")).left().width(170);
    tableFields.add(new Label("Value", game.skin, "title")).left().width(60).padRight(50);
    tableFields.row();
    Field[] fields = ClassReflection.getFields(currentStyle.getClass());
    for (final Field field : fields) {
        try {
            // Grey optional
            if (game.opt.isFieldOptional(currentStyle.getClass(), field.getName())) {
                tableFields.add(new Label(field.getName(), game.skin, "optional")).left();
            } else {
                tableFields.add(new Label(field.getName(), game.skin, "default")).left();
            }
            Actor actor;
            // field type
            String name = field.getType().getSimpleName();
            Object obj = field.get(currentStyle);
            if (name.equals("Drawable")) {
                /**
                 * Handle Drawable object
                 */
                Drawable drawable = (Drawable) field.get(currentStyle);
                String resourceName = "";
                ImageTextButton.ImageTextButtonStyle buttonStyle = new ImageTextButton.ImageTextButtonStyle(game.skin.getDrawable("default-round"), game.skin.getDrawable("default-round-down"), game.skin.getDrawable("default-round"), game.skin.getFont("default-font"));
                if (drawable != null) {
                    resourceName = game.skinProject.resolveObjectName(Drawable.class, drawable);
                    buttonStyle.imageUp = drawable;
                } else {
                    buttonStyle.up = game.skinProject.getDrawable("default-rect");
                    buttonStyle.checked = game.skinProject.getDrawable("default-rect");
                }
                actor = new ImageTextButton(resourceName, buttonStyle);
                ((ImageTextButton) actor).setClip(true);
                actor.addListener(new ChangeListener() {

                    @Override
                    public void changed(ChangeEvent event, Actor actor) {
                        showDrawableDialog(field);
                    }
                });
            } else if (name.equals("Color")) {
                /**
                 * Handle Color object
                 */
                Color color = (Color) field.get(currentStyle);
                ImageTextButton.ImageTextButtonStyle buttonStyle = new ImageTextButton.ImageTextButtonStyle(game.skin.getDrawable("default-round"), game.skin.getDrawable("default-round-down"), game.skin.getDrawable("default-round"), game.skin.getFont("default-font"));
                String resourceName = "";
                if (color != null) {
                    resourceName = game.skinProject.resolveObjectName(Color.class, color);
                    resourceName += " (" + color.toString() + ")";
                    // Create drawable on the fly
                    Pixmap pixmap = new Pixmap(18, 18, Pixmap.Format.RGBA8888);
                    pixmap.setColor(color);
                    pixmap.fill();
                    pixmap.setColor(Color.BLACK);
                    pixmap.drawRectangle(0, 0, 18, 18);
                    Texture texture = new Texture(pixmap);
                    buttonStyle.imageUp = new SpriteDrawable(new Sprite(texture));
                    pixmap.dispose();
                } else {
                    buttonStyle.up = game.skinProject.getDrawable("default-rect");
                    buttonStyle.checked = game.skinProject.getDrawable("default-rect");
                }
                actor = new ImageTextButton(resourceName, buttonStyle);
                ((ImageTextButton) actor).setClip(true);
                actor.addListener(new ChangeListener() {

                    @Override
                    public void changed(ChangeEvent event, Actor actor) {
                        showColorPickerDialog(field);
                    }
                });
            } else if (name.equals("BitmapFont")) {
                /**
                 * Handle BitmapFont object
                 */
                BitmapFont font = (BitmapFont) field.get(currentStyle);
                String resourceName = "";
                ImageTextButton.ImageTextButtonStyle buttonStyle = new ImageTextButton.ImageTextButtonStyle(game.skin.getDrawable("default-round"), game.skin.getDrawable("default-round-down"), game.skin.getDrawable("default-round"), game.skin.getFont("default-font"));
                if (font != null) {
                    resourceName = game.skinProject.resolveObjectName(BitmapFont.class, font);
                    buttonStyle.font = font;
                } else {
                    buttonStyle.up = game.skinProject.getDrawable("default-rect");
                    buttonStyle.checked = game.skinProject.getDrawable("default-rect");
                }
                actor = new ImageTextButton(resourceName, buttonStyle);
                ((ImageTextButton) actor).setClip(true);
                actor.addListener(new ChangeListener() {

                    @Override
                    public void changed(ChangeEvent event, Actor actor) {
                        showFontPickerDialog(field);
                    }
                });
            } else if (name.equals("float")) {
                /**
                 * Handle Float object
                 */
                Float value = (Float) field.get(currentStyle);
                String resourceName = "";
                ImageTextButton.ImageTextButtonStyle buttonStyle = new ImageTextButton.ImageTextButtonStyle(game.skin.getDrawable("default-round"), game.skin.getDrawable("default-round-down"), game.skin.getDrawable("default-round"), game.skin.getFont("default-font"));
                if ((value != null) && (value != 0)) {
                    resourceName = String.valueOf(value);
                } else {
                    buttonStyle.up = game.skinProject.getDrawable("default-rect");
                    buttonStyle.checked = game.skinProject.getDrawable("default-rect");
                }
                actor = new ImageTextButton(resourceName, buttonStyle);
                ((ImageTextButton) actor).setClip(true);
                actor.addListener(new ChangeListener() {

                    @Override
                    public void changed(ChangeEvent event, Actor actor) {
                        showFloatInputDialog(field);
                    }
                });
            } else if (name.equals("ListStyle")) {
                /**
                 * Handle ListStyle object
                 */
                ListStyle listStyle = (ListStyle) field.get(currentStyle);
                actor = new SelectBox<String>(game.skin, "default");
                Array<String> items = new Array<String>();
                final ObjectMap<String, ListStyle> values = game.skinProject.getAll(ListStyle.class);
                Iterator<String> it = values.keys().iterator();
                String selection = null;
                while (it.hasNext()) {
                    String key = it.next();
                    items.add(key);
                    if (listStyle == values.get(key)) {
                        selection = key;
                    }
                }
                ((SelectBox) actor).setItems(items);
                if (selection != null) {
                    ((SelectBox) actor).setSelected(selection);
                }
                actor.addListener(new ChangeListener() {

                    @Override
                    public void changed(ChangeEvent event, Actor actor) {
                        String selection = (String) ((SelectBox) actor).getSelected();
                        try {
                            field.set(currentStyle, values.get(selection));
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                        game.screenMain.saveToSkin();
                        refresh();
                        game.screenMain.paneOptions.updateSelectedTableFields();
                        game.screenMain.panePreview.refresh();
                    }
                });
            } else if (name.equals("ScrollPaneStyle")) {
                /**
                 * Handle ListStyle object
                 */
                ScrollPaneStyle scrollStyle = (ScrollPaneStyle) field.get(currentStyle);
                actor = new SelectBox<String>(game.skin, "default");
                Array<String> items = new Array<String>();
                final ObjectMap<String, ScrollPaneStyle> values = game.skinProject.getAll(ScrollPaneStyle.class);
                Iterator<String> it = values.keys().iterator();
                String selection = null;
                while (it.hasNext()) {
                    String key = it.next();
                    items.add(key);
                    if (scrollStyle == values.get(key)) {
                        selection = key;
                    }
                }
                ((SelectBox) actor).setItems(items);
                if (selection != null) {
                    ((SelectBox) actor).setSelected(selection);
                }
                actor.addListener(new ChangeListener() {

                    @Override
                    public void changed(ChangeEvent event, Actor actor) {
                        String selection = (String) ((SelectBox) actor).getSelected();
                        try {
                            field.set(currentStyle, values.get(selection));
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                        game.screenMain.saveToSkin();
                        refresh();
                        game.screenMain.paneOptions.updateSelectedTableFields();
                        game.screenMain.panePreview.refresh();
                    }
                });
            } else {
                Gdx.app.log("OptionsPane", "Unknown type: " + name);
                actor = new Label("Unknown Type", game.skin);
            }
            tableFields.add(actor).left().height(32).padRight(24).expandX().fillX();
            tableFields.row();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
Also used : ListStyle(com.badlogic.gdx.scenes.scene2d.ui.List.ListStyle) ImageTextButton(com.badlogic.gdx.scenes.scene2d.ui.ImageTextButton) Label(com.badlogic.gdx.scenes.scene2d.ui.Label) Texture(com.badlogic.gdx.graphics.Texture) TextField(com.badlogic.gdx.scenes.scene2d.ui.TextField) Field(com.badlogic.gdx.utils.reflect.Field) ImageButton(com.badlogic.gdx.scenes.scene2d.ui.ImageButton) ObjectMap(com.badlogic.gdx.utils.ObjectMap) Actor(com.badlogic.gdx.scenes.scene2d.Actor) Iterator(java.util.Iterator) ChangeListener(com.badlogic.gdx.scenes.scene2d.utils.ChangeListener) BitmapFont(com.badlogic.gdx.graphics.g2d.BitmapFont) SpriteDrawable(com.badlogic.gdx.scenes.scene2d.utils.SpriteDrawable) Sprite(com.badlogic.gdx.graphics.g2d.Sprite) SelectBox(com.badlogic.gdx.scenes.scene2d.ui.SelectBox) Color(com.badlogic.gdx.graphics.Color) Drawable(com.badlogic.gdx.scenes.scene2d.utils.Drawable) SpriteDrawable(com.badlogic.gdx.scenes.scene2d.utils.SpriteDrawable) Array(com.badlogic.gdx.utils.Array) Pixmap(com.badlogic.gdx.graphics.Pixmap) ScrollPaneStyle(com.badlogic.gdx.scenes.scene2d.ui.ScrollPane.ScrollPaneStyle)

Example 69 with ChangeListener

use of com.badlogic.gdx.scenes.scene2d.utils.ChangeListener in project gdx-skineditor by cobolfoo.

the class WelcomeScreen method show.

@Override
public void show() {
    Table table = new Table(game.skin);
    table.setFillParent(true);
    table.setBackground(game.skin.getDrawable("dialogDim"));
    stage.addActor(table);
    Table tableContent = new Table(game.skin);
    tableContent.left();
    tableContent.add(new Label("Project List", game.skin, "title")).left().row();
    listProjects = new List<String>(game.skin);
    ScrollPane scrollPane = new ScrollPane(listProjects, game.skin);
    tableContent.add(scrollPane).width(320).height(200).row();
    Table tableButtons = new Table(game.skin);
    TextButton buttonNewProject = new TextButton("New Project", game.skin);
    final TextButton buttonOpen = new TextButton("Open", game.skin);
    final TextButton buttonDelete = new TextButton("Delete", game.skin);
    buttonOpen.setDisabled(true);
    buttonDelete.setDisabled(true);
    tableButtons.add(buttonNewProject).pad(5).expandX().fillX();
    tableButtons.add(buttonOpen).pad(5).width(92);
    tableButtons.add(buttonDelete).pad(5).width(92);
    tableContent.add(tableButtons).expandX().fillX();
    table.add(tableContent);
    Gdx.input.setInputProcessor(stage);
    listProjects.addListener(new ChangeListener() {

        @Override
        public void changed(ChangeEvent event, Actor actor) {
            if (listProjects.getSelected() != null) {
                buttonOpen.setDisabled(false);
                buttonDelete.setDisabled(false);
            } else {
                buttonOpen.setDisabled(true);
                buttonDelete.setDisabled(true);
            }
        }
    });
    buttonNewProject.addListener(new ChangeListener() {

        @Override
        public void changed(ChangeEvent event, Actor actor) {
            showNewProjectDialog();
        }
    });
    buttonOpen.addListener(new ChangeListener() {

        @Override
        public void changed(ChangeEvent event, Actor actor) {
            game.screenMain.setCurrentProject((String) listProjects.getSelected());
            game.setScreen(game.screenMain);
        }
    });
    buttonDelete.addListener(new ChangeListener() {

        @Override
        public void changed(ChangeEvent event, Actor actor) {
            showDeleteDialog();
        }
    });
    refreshProjects();
// NinePatchEditorDialog dlg = new NinePatchEditorDialog(game);
// dlg.show(stage);
}
Also used : TextButton(com.badlogic.gdx.scenes.scene2d.ui.TextButton) Table(com.badlogic.gdx.scenes.scene2d.ui.Table) ScrollPane(com.badlogic.gdx.scenes.scene2d.ui.ScrollPane) Actor(com.badlogic.gdx.scenes.scene2d.Actor) Label(com.badlogic.gdx.scenes.scene2d.ui.Label) ChangeListener(com.badlogic.gdx.scenes.scene2d.utils.ChangeListener)

Example 70 with ChangeListener

use of com.badlogic.gdx.scenes.scene2d.utils.ChangeListener in project AnotherMonekyParadox by SantiagoMille.

the class PantallaDeveloper method crearMenu.

private void crearMenu() {
    stageMenu = new Stage(vista);
    prefs = Gdx.app.getPreferences("AnotherMonkeyPreferenceStory");
    Skin skin = new Skin(Gdx.files.internal("skin/comic-ui.json"));
    imgBackground = new Texture("pantalla_config.png");
    spriteBackground = new Sprite(imgBackground);
    spriteBackground.setAlpha(0.7f);
    container = new Table();
    stageMenu.addActor(container);
    container.setFillParent(true);
    container.setPosition(0, 30);
    Table table = new Table();
    final ScrollPane scroll = new ScrollPane(table, skin);
    // Boton Return
    TextureRegionDrawable trdReturn = new TextureRegionDrawable(new TextureRegion(new Texture("go-back.png")));
    ImageButton btnReturn = new ImageButton(trdReturn);
    btnReturn.setPosition(ANCHO - 80, ALTO - 30 - btnReturn.getHeight());
    // Click en boton Return
    btnReturn.addListener(new ClickListener() {

        @Override
        public void clicked(InputEvent event, float x, float y) {
            super.clicked(event, x, y);
            prefs.putFloat("Difficulty", difficulty);
            prefs.putFloat("Sensitivity", sensitivity);
            main.setScreen(new PantallaMenu(main));
        }
    });
    InputListener stopTouchDown = new InputListener() {

        public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
            event.stop();
            difficulty = x;
            return false;
        }
    };
    InputListener stopTouchDown2 = new InputListener() {

        public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
            event.stop();
            sensitivity = x;
            return false;
        }
    };
    table.pad(10).defaults().expandX().space(4);
    titulo = new Texto(1, 1, 1);
    table.row();
    table.row();
    table.row();
    table.row();
    table.add(new Label("\n\n\n\n\n\n\n\n\n\n\n ", skin));
    table.row();
    table.add(new Label("\n\n\n\n\n\n\n\n\n\n\n ", skin));
    TextButton buttonVolumen = new TextButton("Difficulty", skin);
    table.add(buttonVolumen);
    buttonVolumen.addListener(new ClickListener() {

        public void clicked(InputEvent event, float x, float y) {
            System.out.println("click " + x + ", " + y);
        }
    });
    Slider sliderDif = new Slider(0, 100, 1, false, skin);
    // Stops touchDown events from propagating to the FlickScrollPane.
    sliderDif.addListener(stopTouchDown);
    table.add(sliderDif);
    table.add(new Label("                                                                                                               ", skin));
    table.row();
    table.add(new Label(" ", skin));
    table.row();
    table.add(new Label(" ", skin));
    table.row();
    table.add(new Label("                                                                                             ", skin)).expandX().fillX();
    TextButton buttonSensitivity = new TextButton("Sensitivity", skin);
    table.add(buttonSensitivity);
    buttonSensitivity.addListener(new ClickListener() {

        public void clicked(InputEvent event, float x, float y) {
            System.out.println("click " + x + ", " + y);
        }
    });
    Slider sliderSens = new Slider(0, 100, 1, false, skin);
    // Stops touchDown events from propagating to the FlickScrollPane.
    sliderSens.addListener(stopTouchDown2);
    table.add(sliderSens);
    table.add(new Label("                                                                                                               ", skin));
    final TextButton creditsButton = new TextButton("Creditos", skin.get("default", TextButton.TextButtonStyle.class));
    creditsButton.setChecked(true);
    creditsButton.addListener(new ChangeListener() {

        public void changed(ChangeEvent event, Actor actor) {
            scroll.setFlickScroll(creditsButton.isChecked());
            prefs.putFloat("Difficulty", difficulty);
            prefs.putFloat("Sensitivity", sensitivity);
            main.setScreen(new PantallaCredits(main));
        }
    });
    container.add(scroll).expand().fill().colspan(4);
    container.row().space(10).padBottom(10);
    container.add(new Label("  ", skin));
    table.row();
    table.add(new Label("\n\n\n\n\n\n\n\n\n\n\n ", skin));
    table.row();
    table.add(new Label("\n\n\n\n\n\n\n\n\n\n\n ", skin));
    table.row();
    container.add(creditsButton).left().expandX();
    stageMenu.addActor(btnReturn);
    Gdx.input.setInputProcessor(stageMenu);
    float ddiiff = prefs.getFloat("Difficulty");
    sliderDif.setX(ddiiff);
    sliderSens.setX(prefs.getFloat("Sensitivity"));
}
Also used : TextButton(com.badlogic.gdx.scenes.scene2d.ui.TextButton) Table(com.badlogic.gdx.scenes.scene2d.ui.Table) Sprite(com.badlogic.gdx.graphics.g2d.Sprite) Slider(com.badlogic.gdx.scenes.scene2d.ui.Slider) Label(com.badlogic.gdx.scenes.scene2d.ui.Label) TextureRegionDrawable(com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable) Texture(com.badlogic.gdx.graphics.Texture) TextureRegion(com.badlogic.gdx.graphics.g2d.TextureRegion) ImageButton(com.badlogic.gdx.scenes.scene2d.ui.ImageButton) InputListener(com.badlogic.gdx.scenes.scene2d.InputListener) ScrollPane(com.badlogic.gdx.scenes.scene2d.ui.ScrollPane) Actor(com.badlogic.gdx.scenes.scene2d.Actor) Stage(com.badlogic.gdx.scenes.scene2d.Stage) Skin(com.badlogic.gdx.scenes.scene2d.ui.Skin) ChangeListener(com.badlogic.gdx.scenes.scene2d.utils.ChangeListener) InputEvent(com.badlogic.gdx.scenes.scene2d.InputEvent) ClickListener(com.badlogic.gdx.scenes.scene2d.utils.ClickListener)

Aggregations

Actor (com.badlogic.gdx.scenes.scene2d.Actor)71 ChangeListener (com.badlogic.gdx.scenes.scene2d.utils.ChangeListener)71 TextButton (com.badlogic.gdx.scenes.scene2d.ui.TextButton)51 Label (com.badlogic.gdx.scenes.scene2d.ui.Label)43 Table (com.badlogic.gdx.scenes.scene2d.ui.Table)38 TextField (com.badlogic.gdx.scenes.scene2d.ui.TextField)25 Stage (com.badlogic.gdx.scenes.scene2d.Stage)22 Dialog (com.badlogic.gdx.scenes.scene2d.ui.Dialog)21 InputEvent (com.badlogic.gdx.scenes.scene2d.InputEvent)15 ScrollPane (com.badlogic.gdx.scenes.scene2d.ui.ScrollPane)14 SelectBox (com.badlogic.gdx.scenes.scene2d.ui.SelectBox)12 Skin (com.badlogic.gdx.scenes.scene2d.ui.Skin)12 InputListener (com.badlogic.gdx.scenes.scene2d.InputListener)11 Button (com.badlogic.gdx.scenes.scene2d.ui.Button)11 Image (com.badlogic.gdx.scenes.scene2d.ui.Image)11 DrawableData (com.ray3k.skincomposer.data.DrawableData)11 ColorData (com.ray3k.skincomposer.data.ColorData)10 Color (com.badlogic.gdx.graphics.Color)9 BitmapFont (com.badlogic.gdx.graphics.g2d.BitmapFont)9 Slider (com.badlogic.gdx.scenes.scene2d.ui.Slider)9