本文整理匯總了Java中com.badlogic.gdx.scenes.scene2d.ui.Slider.setValue方法的典型用法代碼示例。如果您正苦於以下問題:Java Slider.setValue方法的具體用法?Java Slider.setValue怎麽用?Java Slider.setValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.badlogic.gdx.scenes.scene2d.ui.Slider
的用法示例。
在下文中一共展示了Slider.setValue方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addAlbedoRSlider
import com.badlogic.gdx.scenes.scene2d.ui.Slider; //導入方法依賴的package包/類
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);
}
示例2: addMetallicSlider
import com.badlogic.gdx.scenes.scene2d.ui.Slider; //導入方法依賴的package包/類
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);
}
示例3: addAlbedoGSlider
import com.badlogic.gdx.scenes.scene2d.ui.Slider; //導入方法依賴的package包/類
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);
}
示例4: addAlbedoBSlider
import com.badlogic.gdx.scenes.scene2d.ui.Slider; //導入方法依賴的package包/類
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);
}
示例5: addOcclusionlider
import com.badlogic.gdx.scenes.scene2d.ui.Slider; //導入方法依賴的package包/類
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);
}
示例6: addRougnessSlider
import com.badlogic.gdx.scenes.scene2d.ui.Slider; //導入方法依賴的package包/類
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);
}
示例7: LayerController
import com.badlogic.gdx.scenes.scene2d.ui.Slider; //導入方法依賴的package包/類
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);
}
示例8: AudioOptions
import com.badlogic.gdx.scenes.scene2d.ui.Slider; //導入方法依賴的package包/類
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);
}
示例9: addNormalWidgets
import com.badlogic.gdx.scenes.scene2d.ui.Slider; //導入方法依賴的package包/類
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);
}
示例10: addMaxLinearAccelerationController
import com.badlogic.gdx.scenes.scene2d.ui.Slider; //導入方法依賴的package包/類
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);
}
示例11: addMaxLinearSpeedController
import com.badlogic.gdx.scenes.scene2d.ui.Slider; //導入方法依賴的package包/類
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);
}
示例12: addMaxAngularAccelerationController
import com.badlogic.gdx.scenes.scene2d.ui.Slider; //導入方法依賴的package包/類
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);
}
示例13: addMaxAngularSpeedController
import com.badlogic.gdx.scenes.scene2d.ui.Slider; //導入方法依賴的package包/類
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);
}
示例14: SettingsPanel
import com.badlogic.gdx.scenes.scene2d.ui.Slider; //導入方法依賴的package包/類
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();
}
示例15: addSliderWithoutLabel
import com.badlogic.gdx.scenes.scene2d.ui.Slider; //導入方法依賴的package包/類
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;
}