Package com.badlogic.gdx.scenes.scene2d.ui

Examples of com.badlogic.gdx.scenes.scene2d.ui.CheckBox.addListener()


  public static CheckBox newCheckBox( String text, boolean checked, ClickListener listener ) {
    CheckBox cb = new CheckBox( text, UISkin );
    cb.setChecked( checked );
    if( listener != null ) {
      cb.addListener( listener );
    }
    return cb;
  }

  public static SelectBox<String> newSelectBox( String[] items ) {
View Full Code Here


        Label title = new Label("JFIGHTER2DX\nSETTINGS", game.getSkin());
        title.setFontScale(2.5f);

        final CheckBox checkSound = new CheckBox(" SOUND", game.getSkin());
        checkSound.setChecked(prefs.getBoolean("sound"));
        checkSound.addListener(new ClickListener() {
            public void touchUp(InputEvent event, float x, float y, int pointer, int button) {

                prefs.putBoolean("sound", checkSound.isChecked());
            }
        });
View Full Code Here

        Label title = new Label("JBOMBERMANX\nSETTINGS", game.getSkin());
        title.setFontScale(2.5f);

        final CheckBox checkSound = new CheckBox("SOUND", game.getSkin());
        checkSound.setChecked(prefs.getBoolean("sound"));
        checkSound.addListener(new ClickListener() {
            public void touchUp(InputEvent event, float x, float y, int pointer, int button) {

                prefs.putBoolean("sound", checkSound.isChecked());
            }
        });
View Full Code Here

    private CheckBox checkbox (final String name, boolean defaultValue) {
      final CheckBox checkbox = new CheckBox(name, skin);
      checkbox.setChecked(prefs.getBoolean(checkbox.getText().toString(), defaultValue));

      checkbox.addListener(new ChangeListener() {
        public void changed (ChangeEvent event, Actor actor) {
          prefs.putBoolean(name, checkbox.isChecked());
          prefs.flush();
        }
      });
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.