Search in sources :

Example 6 with UISlider

use of org.terasology.nui.widgets.UISlider in project Terasology by MovingBlocks.

the class NumberRangeConstraintWidgetFactory method bindWidgetToSetting.

@Override
protected void bindWidgetToSetting(UIWidget widget) {
    UISlider slider = widget.find("slider", UISlider.class);
    assert slider != null;
    updateSliderIfInteger(slider);
    setSliderRange(slider);
    slider.bindValue(new Binding<Float>() {

        @Override
        public Float get() {
            return getSetting().get().floatValue();
        }

        @Override
        public void set(Float value) {
            setSettingValue(value);
        }
    });
}
Also used : UISlider(org.terasology.nui.widgets.UISlider)

Aggregations

UISlider (org.terasology.nui.widgets.UISlider)6 UILabel (org.terasology.nui.widgets.UILabel)3 Vector2i (org.joml.Vector2i)2 RowLayout (org.terasology.nui.layouts.RowLayout)2 UICheckbox (org.terasology.nui.widgets.UICheckbox)2 UISpace (org.terasology.nui.widgets.UISpace)2 ControllerInfo (org.terasology.engine.config.ControllerConfig.ControllerInfo)1 SettingBinding (org.terasology.engine.config.flexible.bindings.SettingBinding)1 SimpleUri (org.terasology.engine.core.SimpleUri)1 Resolution (org.terasology.engine.core.subsystem.Resolution)1 RegisterBindButton (org.terasology.engine.input.RegisterBindButton)1 Texture (org.terasology.engine.rendering.assets.texture.Texture)1 ViewDistance (org.terasology.engine.rendering.world.viewDistance.ViewDistance)1 ResourceUrn (org.terasology.gestalt.assets.ResourceUrn)1 Module (org.terasology.gestalt.module.Module)1 ModuleEnvironment (org.terasology.gestalt.module.ModuleEnvironment)1 DependencyResolver (org.terasology.gestalt.module.dependencyresolution.DependencyResolver)1 ResolutionResult (org.terasology.gestalt.module.dependencyresolution.ResolutionResult)1 FromModule (org.terasology.gestalt.module.predicates.FromModule)1 Name (org.terasology.gestalt.naming.Name)1