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

Examples of com.badlogic.gdx.scenes.scene2d.ui.Slider$SliderStyle


        CheckBox source = (CheckBox)event.getListenerActor();
        post.bloom.setEnabled( source.isChecked() );
      }
    } );

    final Slider slBloomThreshold = ResourceFactory.newSlider( 0, 1, 0.01f, post.bloom.getThreshold(), new ChangeListener() {
      @Override
      public void changed( ChangeEvent event, Actor actor ) {
        Slider source = (Slider)event.getListenerActor();
        post.bloom.setThreshold( source.getValue() );
      }
    } );

    final Slider slBloomBaseI = ResourceFactory.newSlider( 0, 2, 0.01f, post.bloom.getBaseIntensity(), new ChangeListener() {
      @Override
      public void changed( ChangeEvent event, Actor actor ) {
        Slider source = (Slider)event.getListenerActor();
        post.bloom.setBaseIntesity( source.getValue() );
      }
    } );

    final Slider slBloomBaseS = ResourceFactory.newSlider( 0, 2, 0.01f, post.bloom.getBaseSaturation(), new ChangeListener() {
      @Override
      public void changed( ChangeEvent event, Actor actor ) {
        Slider source = (Slider)event.getListenerActor();
        post.bloom.setBaseSaturation( source.getValue() );
      }
    } );

    final Slider slBloomBloomI = ResourceFactory.newSlider( 0, 2, 0.01f, post.bloom.getBloomIntensity(),
        new ChangeListener() {
          @Override
          public void changed( ChangeEvent event, Actor actor ) {
            Slider source = (Slider)event.getListenerActor();
            post.bloom.setBloomIntesity( source.getValue() );
          }
        } );

    final Slider slBloomBloomS = ResourceFactory.newSlider( 0, 2, 0.01f, post.bloom.getBloomSaturation(),
        new ChangeListener() {
          @Override
          public void changed( ChangeEvent event, Actor actor ) {
            Slider source = (Slider)event.getListenerActor();
            post.bloom.setBloomSaturation( source.getValue() );
          }
        } );

    Table t = ResourceFactory.newTable();
    t.add( cbBloom ).colspan( 2 ).center();
View Full Code Here


        post.curvature.setEnabled( source.isChecked() );

      }
    } );

    final Slider slCurvatureDist = ResourceFactory.newSlider( 0, 2, 0.01f, post.curvature.getDistortion(),
        new ChangeListener() {
          @Override
          public void changed( ChangeEvent event, Actor actor ) {
            Slider source = (Slider)event.getListenerActor();
            post.curvature.setDistortion( source.getValue() );
          }
        } );

    final Slider slCurvatureZoom = ResourceFactory.newSlider( 0, 2, 0.01f, 2f - post.curvature.getZoom(),
        new ChangeListener() {
          @Override
          public void changed( ChangeEvent event, Actor actor ) {
            Slider source = (Slider)event.getListenerActor();
            post.curvature.setZoom( 2f - source.getValue() );
          }
        } );

    Table t = ResourceFactory.newTable();
    t.add( cbCurvature ).colspan( 2 ).center();
View Full Code Here

        CheckBox source = (CheckBox)event.getListenerActor();
        post.crt.setEnabled( source.isChecked() );
      }
    } );

    final Slider slCrtDispersionRC = ResourceFactory.newSlider( -1f, 1f, 0.001f, post.crt.getChromaticDispersion().x,
        new ChangeListener() {
          @Override
          public void changed( ChangeEvent event, Actor actor ) {
            Slider source = (Slider)event.getListenerActor();
            post.crt.setChromaticDispersionRC( source.getValue() );
          }
        } );

    final Slider slCrtDispersionBY = ResourceFactory.newSlider( -1f, 1f, 0.001f, post.crt.getChromaticDispersion().y,
        new ChangeListener() {
          @Override
          public void changed( ChangeEvent event, Actor actor ) {
            Slider source = (Slider)event.getListenerActor();
            post.crt.setChromaticDispersionBY( source.getValue() );
          }
        } );

    slCrtDispersionRC.setSnapToValues( new float[] { 0 }, 0.05f );
    slCrtDispersionBY.setSnapToValues( new float[] { 0 }, 0.05f );

    final Slider slCrtTintR = ResourceFactory.newSlider( 0, 1f, 0.01f, post.crt.getTint().r, new ChangeListener() {
      @Override
      public void changed( ChangeEvent event, Actor actor ) {
        Slider source = (Slider)event.getListenerActor();
        Color tint = post.crt.getTint();
        tint.r = source.getValue();
        post.crt.setTint( tint );
      }
    } );

    final Slider slCrtTintG = ResourceFactory.newSlider( 0, 1f, 0.01f, post.crt.getTint().g, new ChangeListener() {
      @Override
      public void changed( ChangeEvent event, Actor actor ) {
        Slider source = (Slider)event.getListenerActor();
        Color tint = post.crt.getTint();
        tint.g = source.getValue();
        post.crt.setTint( tint );
      }
    } );

    final Slider slCrtTintB = ResourceFactory.newSlider( 0, 1f, 0.01f, post.crt.getTint().b, new ChangeListener() {
      @Override
      public void changed( ChangeEvent event, Actor actor ) {
        Slider source = (Slider)event.getListenerActor();
        Color tint = post.crt.getTint();
        tint.b = source.getValue();
        post.crt.setTint( tint );
      }
    } );

    Table t = ResourceFactory.newTable();
View Full Code Here

        post.vignette.setEnabled( source.isChecked() );

      }
    } );

    final Slider slVignetteI = ResourceFactory.newSlider( 0, 1f, 0.01f, post.vignette.getIntensity(), new ChangeListener() {
      @Override
      public void changed( ChangeEvent event, Actor actor ) {
        Slider source = (Slider)event.getListenerActor();
        post.vignette.setIntensity( source.getValue() );
      }
    } );

    final SelectBox<String> sbGradientMap = ResourceFactory.newSelectBox( new String[] { "Cross processing ", "Sunset ",
        "Mars", "Vivid ", "Greenland ", "Cloudy ", "Muddy " }, new ChangeListener() {
      @Override
      public void changed( ChangeEvent event, Actor actor ) {
        if( post.vignette.isGradientMappingEnabled() ) {
          SelectBox<String> source = (SelectBox)actor;
          switch( source.getSelectedIndex() ) {
          case 0:
            post.vignette.setLutIndexVal( 0, 16 );
            break;
          case 1:
            post.vignette.setLutIndexVal( 0, 5 );
            break;
          case 2:
            post.vignette.setLutIndexVal( 0, 7 );
            break;
          case 3:
            post.vignette.setLutIndexVal( 0, 6 );
            break;
          case 4:
            post.vignette.setLutIndexVal( 0, 8 );
            break;
          case 5:
            post.vignette.setLutIndexVal( 0, 3 );
            break;
          case 6:
            post.vignette.setLutIndexVal( 0, 0 );
            break;
          }
        }
      }
    } );

    sbGradientMap.setSelectedIndex( DefaultGradientMap );
    selectBoxes.add( sbGradientMap );

    final CheckBox cbGradientMapping = ResourceFactory.newCheckBox( " Perform gradient mapping",
        post.vignette.isGradientMappingEnabled(), new ClickListener() {
          @Override
          public void clicked( InputEvent event, float x, float y ) {
            CheckBox source = (CheckBox)event.getListenerActor();
            if( source.isChecked() ) {
              post.vignette.setLutTexture( ResourceFactory.newTexture( "gradient-mapping.png", false ) );
              sbGradientMap.fire( new ChangeListener.ChangeEvent() );
            } else {
              post.vignette.setLutTexture( null );
              post.vignette.setLutIndexVal( 0, -1 );
View Full Code Here

  public static Slider newSlider( float min, float max, float step, float value ) {
    return newSlider( min, max, step, value, null );
  }

  public static Slider newSlider( float min, float max, float step, float value, ChangeListener listener ) {
    Slider s = new Slider( min, max, step, false, UISkin );
    s.setValue( value );
    if( listener != null ) {
      s.addListener( listener );
    }
    return s;
  }
View Full Code Here

      return checkbox;
    }

    private Slider slider (final String name, float defaultValue) {
      final Slider slider = new Slider(0, 1, 0.01f, false, skin);
      slider.setValue(prefs.getFloat(name, defaultValue));

      final Label label = new Label("", skin);
      label.setAlignment(Align.right);
      label.setText(Float.toString((int)(slider.getValue() * 100) / 100f));

      slider.addListener(new ChangeListener() {
        public void changed (ChangeEvent event, Actor actor) {
          label.setText(Float.toString((int)(slider.getValue() * 100) / 100f));
          if (!slider.isDragging()) {
            prefs.putFloat(name, slider.getValue());
            prefs.flush();
          }
        }
      });

View Full Code Here

TOP

Related Classes of com.badlogic.gdx.scenes.scene2d.ui.Slider$SliderStyle

Copyright © 2018 www.massapicom. 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.