private void addAlbedoRSlider(float w, float h, float scale) { lblAR=new Label("Albedo-R:" , skin); lblAR.setFontScale(2.5f*scale); Table tbRes = new Table(); tbRes.add(lblAR).height(60*scale); tbRes.setPosition(115*scale, h - 140*scale); stage.addActor(tbRes); albedoRS = new Slider(0, 1, 0.05f, false, skin); albedoRS.setValue(pbrShader.albedoColor.x); albedoRS.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { pbrShader.albedoColor.x=albedoRS.getValue(); } }); tbRes = new Table(); tbRes.add(albedoRS).width((w-150*scale)/3f).height(60*scale); tbRes.setPosition(800/3*scale, h - 170*scale); stage.addActor(tbRes); }
public MenuScreen(MainGameClass game) { this.game = game; stage = new Stage(new ScreenViewport()); Gdx.input.setInputProcessor(stage); skin = new Skin(Gdx.files.internal("skins/Flat_Earth_UI_Skin/flatearthui/flat-earth-ui.json")); progressBarStyle = skin.get("fancy", ProgressBar.ProgressBarStyle.class); TiledDrawable tiledDrawable = skin.getTiledDrawable("slider-fancy-knob").tint(skin.getColor("selection")); tiledDrawable.setMinWidth(0); progressBarStyle.knobBefore = tiledDrawable; sliderStyle = skin.get("fancy", Slider.SliderStyle.class); sliderStyle.knobBefore = tiledDrawable; layoutTable = new Table(); layoutTable.top(); layoutTable.setFillParent(true); layoutTable.pad(getPixelSizeFromDensityIndependentPixels(50)); }
private void addMetallicSlider(float w, float h, float scale) { lblMet=new Label("Metallic:" , skin); lblMet.setFontScale(2.5f*scale); Table tbRes = new Table(); tbRes.add(lblMet).height(60*scale); tbRes.setPosition(100*scale, h - 20*scale); stage.addActor(tbRes); metallicS = new Slider(0, 1, 0.05f, false, skin); metallicS.setValue(pbrShader.metallicValue); metallicS.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { pbrShader.metallicValue=metallicS.getValue(); } }); tbRes = new Table(); tbRes.add(metallicS).width(w-50*scale).height(60*scale); tbRes.setPosition(800*scale, h - 50*scale); stage.addActor(tbRes); }
private void addAlbedoGSlider(float w, float h, float scale) { lblAG=new Label("Albedo-G:" , skin); lblAG.setFontScale(2.5f*scale); Table tbRes = new Table(); tbRes.add(lblAG).height(60); tbRes.setPosition(115*scale+(w-150*scale)/3f+50*scale, h - 140*scale); stage.addActor(tbRes); albedoGS = new Slider(0, 1, 0.05f, false, skin); albedoGS.setValue(pbrShader.albedoColor.y); albedoGS.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { pbrShader.albedoColor.y=albedoGS.getValue(); } }); tbRes = new Table(); tbRes.add(albedoGS).width((w-150*scale)/3f).height(60*scale); tbRes.setPosition(800*scale/3+(w-150*scale)/3f+50*scale, h - 170*scale); stage.addActor(tbRes); }
private void addAlbedoBSlider(float w, float h, float scale) { lblAB=new Label("Albedo-B:" , skin); lblAB.setFontScale(2.5f*scale); Table tbRes = new Table(); tbRes.add(lblAB).height(60*scale); tbRes.setPosition(115*scale+2*((w-150*scale)/3f+50*scale), h - 140*scale); stage.addActor(tbRes); albedoBS = new Slider(0, 1, 0.05f, false, skin); albedoBS.setValue(pbrShader.albedoColor.z); albedoBS.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { pbrShader.albedoColor.z=albedoBS.getValue(); } }); tbRes = new Table(); tbRes.add(albedoBS).width((w-150*scale)/3f).height(60*scale); tbRes.setPosition(800*scale/3+2*((w-150*scale)/3f+50*scale), h - 170*scale); stage.addActor(tbRes); }
private void addOcclusionlider(float w, float h, float scale) { lblOcl=new Label("Occlusion:" , skin); lblOcl.setFontScale(2.5f*scale); Table tbRes = new Table(); tbRes.add(lblOcl).height(60*scale); tbRes.setPosition(120*scale, h - 200*scale); stage.addActor(tbRes); occlusionS = new Slider(0, 1, 0.05f, false, skin); occlusionS.setValue(pbrShader.ambientOcclusionValue); occlusionS.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { pbrShader.ambientOcclusionValue=occlusionS.getValue(); } }); tbRes = new Table(); tbRes.add(occlusionS).width((w-50*scale)).height(60*scale); tbRes.setPosition(800*scale, h - 230*scale); stage.addActor(tbRes); }
private void addRougnessSlider(float w, float h, float scale) { lblRoug=new Label("Roughness:" , skin); lblRoug.setFontScale(2.5f*scale); Table tbRes = new Table(); tbRes.add(lblRoug).height(120*scale); tbRes.setPosition(130*scale, h - 80*scale); stage.addActor(tbRes); mroughnessS = new Slider(0.6f, 1, 0.01f, false, skin); mroughnessS.setValue(pbrShader.rougness); mroughnessS.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { pbrShader.rougness=mroughnessS.getValue(); } }); tbRes = new Table(); tbRes.add(mroughnessS).width((w-50*scale)).height(60*scale); tbRes.setPosition(800*scale, h - 110*scale); stage.addActor(tbRes); }
@Test @NeedGL public void shouldParseSliderBar() throws Exception { CocoStudioUIEditor editor = new CocoStudioUIEditor( Gdx.files.internal("slideBar/MainScene.json"), null, null, null, null); Group group = editor.createGroup(); Slider slider = group.findActor("Slider_1"); assertThat(slider.getWidth(), is(200f)); assertThat(slider.getHeight(), is(14f)); assertThat(slider.getValue(), is(50f)); Slider.SliderStyle style = slider.getStyle(); assertThat(style.knob, instanceOf(TextureRegionDrawable.class)); assertThat(style.background, instanceOf(TextureRegionDrawable.class)); assertThat(style.knobBefore, instanceOf(TextureRegionDrawable.class)); //assertThat(style.disabledKnob, instanceOf(TextureRegionDrawable.class)); // assertThat(style.knobDown, instanceOf(TextureRegionDrawable.class)); }
public LayerController(TextureAtlas buttonAtlas) { Slider.SliderStyle sliderStyle = new Slider.SliderStyle(); sliderStyle.knob = new TextureRegionDrawable(buttonAtlas.findRegion("slider-knob-up")); sliderStyle.knobDown = new TextureRegionDrawable(buttonAtlas.findRegion("slider-knob-down")); sliderStyle.knobOver = new TextureRegionDrawable(buttonAtlas.findRegion("slider-knob-down")); sliderStyle.background = new TextureRegionDrawable(buttonAtlas.findRegion("slider-background")); slider = new Slider(minLayer, maxLayer, 1, true, sliderStyle); slider.setValue(maxLayer); slider.setAnimateDuration(0.1f); slider.addCaptureListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { setLayer((int) slider.getValue()); } }); add(slider).height(300); }
public AudioOptions (Skin skin) { setName("Audio"); soundSlider = new Slider(0, 1, 0.05f, false, skin); soundSlider.setValue(OrionPrefs.getFloat(FloatValue.AUDIO_SOUND_VOLUME)); musicSlider = new Slider(0, 1, 0.05f, false, skin); musicSlider.setValue(OrionPrefs.getFloat(FloatValue.AUDIO_MUSIC_VOLUME)); musicCheckBox = new CheckBox("Music Enabled", skin); musicCheckBox.setChecked(OrionPrefs.getBoolean(BooleanValue.AUDIO_MUSIC_ENABLED)); soundCheckBox = new CheckBox("Sound Enabled", skin); soundCheckBox.setChecked(OrionPrefs.getBoolean(BooleanValue.AUDIO_MUSIC_ENABLED)); Table soundTable = new Table(); soundTable.add(soundSlider); soundTable.add(soundCheckBox); Table musicTable = new Table(); musicTable.add(musicSlider); musicTable.add(musicCheckBox); add(soundTable); row(); add(musicTable); }
public Slider addSlider(final int min, final int max, final float x, final float y) { Slider _xblockexpression = null; { final Slider slider = this.addSliderWithoutLabel(min, max, x, y); final Label label = this.addLabel((x + 150), (y + 5), ("" + Integer.valueOf(min))); final Procedure2<ChangeListener.ChangeEvent, Actor> _function = new Procedure2<ChangeListener.ChangeEvent, Actor>() { @Override public void apply(final ChangeListener.ChangeEvent $0, final Actor $1) { float _value = slider.getValue(); int _intValue = Float.valueOf(_value).intValue(); String _plus = ("" + Integer.valueOf(_intValue)); label.setText(_plus); } }; MyChangeListener _myChangeListener = new MyChangeListener(_function); slider.addListener(_myChangeListener); _xblockexpression = slider; } return _xblockexpression; }
@Override public void create () { music = Gdx.audio.newMusic(Gdx.files.internal("data/8.12.mp3")); music.play(); buttons = new TextureRegion(new Texture(Gdx.files.internal("data/playback.png"))); batch = new SpriteBatch(); font = new BitmapFont(Gdx.files.internal("data/arial-15.fnt"), false); stage = new Stage(); Skin skin = new Skin(Gdx.files.internal("data/uiskin.json")); slider = new Slider(0, 100, 0.1f, false, skin); slider.setPosition(200, 20); slider.addListener(new ChangeListener() { @Override public void changed (ChangeEvent event, Actor actor) { if (!sliderUpdating && slider.isDragging()) music.setPosition((slider.getValue() / 100f) * songDuration); } }); stage.addActor(slider); Gdx.input.setInputProcessor(stage); }
public static void setup(){ registerSerializer(Actor.class, new ActorSerializer()); registerSerializer(Scene.class, new SceneSerializer()); registerSerializer(ImageJson.class, new ImageJson()); registerSerializer(Label.class, new LabelSerializer()); registerSerializer(Button.class, new ButtonSerializer()); registerSerializer(TextButton.class, new TextButtonSerializer()); registerSerializer(Table.class, new TableSerializer()); registerSerializer(CheckBox.class, new CheckBoxSerializer()); registerSerializer(SelectBox.class, new SelectBoxSerializer()); registerSerializer(List.class, new ListSerializer()); registerSerializer(Slider.class, new SliderSerializer()); registerSerializer(TextField.class, new TextFieldSerializer()); registerSerializer(Touchpad.class, new TouchpadSerializer()); registerSerializer(Sprite.class, new SpriteSerializer()); registerSerializer(Dialog.class, new DialogSerializer()); registerSerializer(SplitPane.class, new SplitPaneSerializer()); registerSerializer(ScrollPane.class, new ScrollPaneSerializer()); registerSerializer(Stack.class, new StackSerializer()); registerSerializer(Tree.class, new TreeSerializer()); registerSerializer(Table.class, new TableSerializer()); registerSerializer(ButtonGroup.class, new ButtonGroupSerializer()); registerSerializer(HorizontalGroup.class, new HorizontalGroupSerializer()); registerSerializer(VerticalGroup.class, new VerticalGroupSerializer()); }
private void addNormalWidgets () { ProgressBar progressbar = new ProgressBar(0, 100, 1, true, VisUI.getSkin()); Slider slider = new Slider(0, 100, 1, true, VisUI.getSkin()); Slider sliderDisabled = new Slider(0, 100, 1, true, VisUI.getSkin()); progressbar.setValue(50); slider.setValue(50); sliderDisabled.setValue(50); sliderDisabled.setDisabled(true); VisTable progressbarTable = new VisTable(true); progressbarTable.add(progressbar); progressbarTable.add(slider); progressbarTable.add(sliderDisabled); add(progressbarTable); }
protected void addMaxLinearAccelerationController (Table table, final Limiter limiter, float minValue, float maxValue, float step) { final Label labelMaxLinAcc = new Label("Max.Linear Acc.[" + limiter.getMaxLinearAcceleration() + "]", container.skin); table.add(labelMaxLinAcc); table.row(); Slider maxLinAcc = new Slider(minValue, maxValue, step, false, container.skin); maxLinAcc.setValue(limiter.getMaxLinearAcceleration()); maxLinAcc.addListener(new ChangeListener() { @Override public void changed (ChangeEvent event, Actor actor) { Slider slider = (Slider)actor; limiter.setMaxLinearAcceleration(slider.getValue()); labelMaxLinAcc.setText("Max.Linear Acc.[" + limiter.getMaxLinearAcceleration() + "]"); } }); table.add(maxLinAcc); }
protected void addMaxLinearSpeedController (Table table, final Limiter limiter, float minValue, float maxValue, float step) { final Label labelMaxSpeed = new Label("Max.Lin.Speed [" + limiter.getMaxLinearSpeed() + "]", container.skin); table.add(labelMaxSpeed); table.row(); Slider maxSpeed = new Slider(minValue, maxValue, step, false, container.skin); maxSpeed.setValue(limiter.getMaxLinearSpeed()); maxSpeed.addListener(new ChangeListener() { @Override public void changed (ChangeEvent event, Actor actor) { Slider slider = (Slider)actor; limiter.setMaxLinearSpeed(slider.getValue()); labelMaxSpeed.setText("Max.Lin.Speed [" + limiter.getMaxLinearSpeed() + "]"); } }); table.add(maxSpeed); }
protected void addMaxAngularAccelerationController (Table table, final Limiter limiter, float minValue, float maxValue, float step) { final Label labelMaxAngAcc = new Label("Max.Ang.Acc.[" + limiter.getMaxAngularAcceleration() + "]", container.skin); table.add(labelMaxAngAcc); table.row(); Slider maxAngAcc = new Slider(minValue, maxValue, step, false, container.skin); maxAngAcc.setValue(limiter.getMaxAngularAcceleration()); maxAngAcc.addListener(new ChangeListener() { @Override public void changed (ChangeEvent event, Actor actor) { Slider slider = (Slider)actor; limiter.setMaxAngularAcceleration(slider.getValue()); labelMaxAngAcc.setText("Max.Ang.Acc.[" + limiter.getMaxAngularAcceleration() + "]"); } }); table.add(maxAngAcc); }
protected void addMaxAngularSpeedController (Table table, final Limiter limiter, float minValue, float maxValue, float step) { final Label labelMaxAngSpeed = new Label("Max.Ang.Speed [" + limiter.getMaxAngularSpeed() + "]", container.skin); table.add(labelMaxAngSpeed); table.row(); Slider maxAngSpeed = new Slider(minValue, maxValue, step, false, container.skin); maxAngSpeed.setValue(limiter.getMaxAngularSpeed()); maxAngSpeed.addListener(new ChangeListener() { @Override public void changed (ChangeEvent event, Actor actor) { Slider slider = (Slider)actor; limiter.setMaxAngularSpeed(slider.getValue()); labelMaxAngSpeed.setText("Max.Ang.Speed [" + limiter.getMaxAngularSpeed() + "]"); } }); table.add(maxAngSpeed); }
@Override public Actor getActor(VisualSettingManager visualSettingManager) { switch (type) { case TextField: return getTextField(visualSettingManager); case Slider: return getSlider(visualSettingManager); } return null; }
public SettingsPanel(Skin skin) { super(skin); _musicVolSlider = new Slider(0, 1f, 0.01f, false, Assets._skin); _soundFxSlider = new Slider(0, 1f, 0.01f, false, Assets._skin); _musicVolSlider.setValue(Game.VOLUME_MUSIC); _soundFxSlider.setValue(Game.VOLUME_SOUNDFX); Label musicLbl = new Label("Music" , Assets._skin , "fontVeraRg20" , "white"); Label sfxLbl = new Label("Sound Effects" , Assets._skin , "fontVeraRg20" , "white"); this.add(musicLbl).align(Align.left).row(); this.add(_musicVolSlider).spaceBottom(20f).row(); this.add(sfxLbl).align(Align.left).row(); this.add(_soundFxSlider).spaceBottom(20).row(); }
private void valueTest(String label, final ActionHandler<Float> runnable) { final Slider sl = new Slider(-100, 100, 0.1f, false, skin); sl.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { runnable.run(sl.getValue()); } }); table.add(label); table.add(sl); table.row(); }
public Slider addSliderWithoutLabel(final int min, final int max, final float x, final float y, final float step) { Slider _xblockexpression = null; { Skin _skin = this.manager.getSkin(); final Slider slider = new Slider(min, max, step, false, _skin); slider.setPosition(x, y); slider.setValue(min); slider.setWidth(200); this.stage.addActor(slider); _xblockexpression = slider; } return _xblockexpression; }
private Slider makeMusicVolumeSlider() { final Slider slider = new Slider(0f, 1f, 0.1f, false, TowerAssetManager.getCustomSkin()); slider.setValue(DroidTowersGame.getSoundController().getMusicVolume()); slider.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { DroidTowersGame.getSoundController().setMusicVolume(slider.getValue()); } }); return slider; }
private Slider makeSoundEffectsVolumeSlider() { final Slider slider = new Slider(0f, 1f, 0.1f, false, TowerAssetManager.getCustomSkin()); slider.setValue(DroidTowersGame.getSoundController().getEffectsVolume()); slider.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { preferences.putFloat("effectsVolume", slider.getValue()); DroidTowersGame.getSoundController().setEffectsVolume(slider.getValue()); } }); return slider; }
public void createActor(String type){ switch(type){ case "Label": if(Asset.fontMap.size != 0){ LabelStyle ls = new LabelStyle(); ls.font = Asset.fontMap.firstValue(); Label label = new Label("Text", ls); setName(label); } break; case "Image": if(Asset.texMap.size != 0){ setName(new ImageJson(Asset.texMap.firstKey())); } break; case "Texture":setName(new ImageJson(Content.assetPanel.list.getSelectedValue()));break; case "Sprite":setName(new Sprite(1f, Asset.texMap.firstKey()));break; case "Particle": //ParticleEffect pe = new ParticleEffect(); //pe.load(effectFile, imagesDir); break; case "Button":setName(new Button(Asset.skin));break; case "TextButton":setName(new TextButton("Text", Asset.skin));break; case "TextField":setName(new TextField("", Asset.skin));break; case "Table":setName(new Table(Asset.skin));break; case "CheckBox":setName(new CheckBox("Check", Asset.skin));break; case "SelectBox":setName(new SelectBox(new String[]{"First","Second","Third"}, Asset.skin));break; case "List":setName(new List(new String[]{"First","Second","Third"}, Asset.skin));break; case "Slider":setName(new Slider(0, 10, 1, false, Asset.skin));break; case "Dialog":setName(new Dialog("Title", Asset.skin));break; case "Touchpad":setName(new Touchpad(5, Asset.skin));break; case "Map":setName(new Map(1, 24));break; case "None":break; default:break; } }
@Override public Actor read(Json json, JsonValue jv, Class arg2) { Slider slider = new Slider(jv.getFloat("min"),jv.getFloat("max"),jv.getFloat("step") , false, Asset.skin); slider.setValue(jv.getFloat("value")); readActor(jv, slider); return slider; }
@Override public void write(Json json, Actor slider, Class arg2) { json.writeObjectStart(); writeActor(json, slider); json.writeValue("min", ((Slider)slider).getMinValue()); json.writeValue("max", ((Slider)slider).getMaxValue()); json.writeValue("step", ((Slider)slider).getStepSize()); json.writeValue("value", ((Slider)slider).getValue()); json.writeObjectEnd(); }
private void init() { Skin skin = SkinService.getSkin(); ok = new TextButton("Ok", skin, "choice"); sfxVolume = new Slider(0, 1f, 0.1f, false, skin); musicVolume = new Slider(0, 1f, 0.1f, false, skin); enableDebug = new CheckBox("", skin); }
public TemplateBar(Controller controller) { super(false); Skin skin = controller.getApplicationAssets().getSkin(); I18N i18N = controller.getApplicationAssets().getI18N(); this.controller = controller; auxWalk = 0; slider = new Slider(0, 1, 1, false, skin, SkinConstants.STYLE_TEMPLATE); topBar = new LinearLayout(true, skin.getDrawable(SkinConstants.DRAWABLE_TOOLBAR)); topBar.backgroundColor(skin.getColor(SkinConstants.COLOR_BROWN_MOKA)); title = new Label("", skin, SkinConstants.STYLE_TOOLBAR); IconButton save = WidgetBuilder.toolbarIcon(SkinConstants.IC_CHECK, i18N.m("accept")); IconButton close = WidgetBuilder.toolbarIcon(SkinConstants.IC_CLOSE, i18N.m("cancel")); textContainer = new Container<Label>(); textContainer.setActor(title); textContainer.fillX(); topBar.add(save); topBar.add(textContainer).marginLeft(PAD).marginRight(PAD); topBar.add(slider).expandX(); topBar.addSpace(); topBar.add(close); add(topBar).top().expandX().left(); }
public IntegerSetting(int i, int rangeStart, int rangeEnd) { this(i, rangeStart, rangeEnd, Type.Slider); }
public FloatSetting(float f, float rangeStart, float rangeEnd) { this(f, rangeStart, rangeEnd, Type.Slider); }
public Slider getMusicVolSlider() { return _musicVolSlider; }
public Slider getSoundFxSlider() { return _soundFxSlider; }
public void resetProperties() { properties.clear(); if (clazz.equals(Button.class)) { newStyleProperties(ButtonStyle.class); } else if (clazz.equals(CheckBox.class)) { newStyleProperties(CheckBoxStyle.class); properties.get("checkboxOn").optional = false; properties.get("checkboxOff").optional = false; properties.get("font").optional = false; } else if (clazz.equals(ImageButton.class)) { newStyleProperties(ImageButtonStyle.class); } else if (clazz.equals(ImageTextButton.class)) { newStyleProperties(ImageTextButtonStyle.class); properties.get("font").optional = false; } else if (clazz.equals(Label.class)) { newStyleProperties(LabelStyle.class); properties.get("font").optional = false; } else if (clazz.equals(List.class)) { newStyleProperties(ListStyle.class); properties.get("font").optional = false; properties.get("fontColorSelected").optional = false; properties.get("fontColorUnselected").optional = false; properties.get("selection").optional = false; } else if (clazz.equals(ProgressBar.class)) { newStyleProperties(ProgressBarStyle.class); //Though specified as optional in the doc, there are bugs without "background" being mandatory properties.get("background").optional = false; } else if (clazz.equals(ScrollPane.class)) { newStyleProperties(ScrollPaneStyle.class); } else if (clazz.equals(SelectBox.class)) { newStyleProperties(SelectBoxStyle.class); properties.get("font").optional = false; properties.get("fontColor").optional = false; properties.get("scrollStyle").optional = false; properties.get("scrollStyle").value = "default"; properties.get("listStyle").optional = false; properties.get("listStyle").value = "default"; } else if (clazz.equals(Slider.class)) { newStyleProperties(SliderStyle.class); //Though specified as optional in the doc, there are bugs without "background" being mandatory properties.get("background").optional = false; } else if (clazz.equals(SplitPane.class)) { newStyleProperties(SplitPaneStyle.class); properties.get("handle").optional = false; } else if (clazz.equals(TextButton.class)) { newStyleProperties(TextButtonStyle.class); properties.get("font").optional = false; } else if (clazz.equals(TextField.class)) { newStyleProperties(TextFieldStyle.class); properties.get("font").optional = false; properties.get("fontColor").optional = false; } else if (clazz.equals(TextTooltip.class)) { newStyleProperties(TextTooltipStyle.class); properties.get("label").optional = false; properties.get("label").value = "default"; } else if (clazz.equals(Touchpad.class)) { newStyleProperties(TouchpadStyle.class); } else if (clazz.equals(Tree.class)) { newStyleProperties(TreeStyle.class); properties.get("plus").optional = false; properties.get("minus").optional = false; } else if (clazz.equals(Window.class)) { newStyleProperties(WindowStyle.class); properties.get("titleFont").optional = false; } }
@Override public void changed(ChangeEvent event, Actor actor) { if (actor == playbackRateSlider) { newPlaybackRate = ((Slider) actor).getValue(); GlobalConfiguration.playbackRate = newPlaybackRate; playbackRateLabel.setText("Playback Rate" + (newPlaybackRate.compareTo(1.0f) == 0 ? "" : "(no music)")); playbackRateValueLabel.setText(String.format("%.2f", newPlaybackRate) + "x"); } if (actor == aSlider) { newAPosition = ((Slider) actor).getValue(); GlobalConfiguration.aTime = newAPosition; aLabel.setText("Start Time: " + String.format("%.2f", newAPosition)); if (newAPosition + 5f > newBPosition) { newBPosition = newAPosition + 5f; bSlider.setValue(newBPosition); bLabel.setText("End Time: " + String.format("%.2f", newBPosition)); GlobalConfiguration.bTime = newBPosition; } if (theSong != null) { theSong.pause(); theSong.setPosition(newAPosition); theSong.setVolume(GlobalConfiguration.songVolume / 100f); theSong.play(); } } if (actor == bSlider) { newBPosition = ((Slider) actor).getValue(); GlobalConfiguration.bTime = newBPosition; bLabel.setText("End Time: " + String.format("%.2f", newBPosition)); if (newBPosition - 5f < newAPosition) { newAPosition = newBPosition - 5f; aSlider.setValue(newAPosition); aLabel.setText("Start Time: " + String.format("%.2f", newAPosition)); GlobalConfiguration.aTime = newAPosition; } } if (actor == abModeChooser) { GlobalConfiguration.playbackMode = GlobalConfiguration.playbackMode == null ? 1 : (GlobalConfiguration.playbackMode + 1) % modes.length; abModeChooser.setText("Game Mode (Tap to change): " + modes[GlobalConfiguration.playbackMode]); aLabel.setVisible(GlobalConfiguration.playbackMode.equals(SongUtils.GAME_MODE_ABREPEAT)); aSlider.setVisible(GlobalConfiguration.playbackMode.equals(SongUtils.GAME_MODE_ABREPEAT)); bLabel.setVisible(GlobalConfiguration.playbackMode.equals(SongUtils.GAME_MODE_ABREPEAT)); bSlider.setVisible(GlobalConfiguration.playbackMode.equals(SongUtils.GAME_MODE_ABREPEAT)); } }