SliderWidgetBuilder
This page talks about SliderWidgetBuilder class
This page talks about SliderWidgetBuilder class
The class provides a builder pattern for creating SliderWidget
objects.
client
: The MinecraftClient
instance.
x
: The x position of the widget.
y
: The y position of the widget.
width
: The width of the widget.
height
: The height of the widget.
label
: The label displayed above the slider.
value
: The initial value of the slider.
minValue
: The minimum value of the slider.
maxValue
: The maximum value of the slider.
selectedWidget
: The widget that this slider is associated with.
Constructs a SliderWidgetBuilder
object with the given client instance.
Sets the x position of the widget.
Sets the y position of the widget.
Sets the width of the widget.
Sets the height of the widget.
Sets the label displayed above the slider.
Sets the initial value of the slider.
Sets the minimum value of the slider.
Sets the maximum value of the slider.
Sets the widget that this slider is associated with.
Builds and returns a new SliderWidget
object with the values specified by this builder.
Here's an example of how to use a SliderWidgetBuilder
to create a new SliderWidget
in your Minecraft Fabric mod:
You can also do it like:
In this example, we create a new SliderWidgetBuilder
and use its setter methods to specify values for its fields. We then call its build
method to create a new SliderWidget
with these values.