Package net.uku3lig.ukulib.config.option
Class IntSliderOption
java.lang.Object
net.uku3lig.ukulib.config.option.IntSliderOption
- All Implemented Interfaces:
WidgetCreator
An int option, represented by a slider.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IntFunction<net.minecraft.text.Text>Converts an int to Text using its String representation. -
Constructor Summary
ConstructorsConstructorDescriptionIntSliderOption(String key, int initialValue, IntConsumer setter, IntFunction<net.minecraft.text.Text> valueToText, int min, int max) Creates a slider option, with no step or tooltip.IntSliderOption(String key, int initialValue, IntConsumer setter, IntFunction<net.minecraft.text.Text> valueToText, int min, int max, int step) Creates a slider option, with no tooltip.IntSliderOption(String key, int initialValue, IntConsumer setter, IntFunction<net.minecraft.text.Text> valueToText, int min, int max, int step, net.minecraft.client.option.SimpleOption.TooltipFactory<Integer> tooltipFactory) Creates a slider option. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.client.gui.widget.ClickableWidgetcreateWidget(int x, int y, int width, int height) Creates the widget.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.uku3lig.ukulib.config.option.WidgetCreator
wide
-
Field Details
-
DEFAULT_INT_TO_TEXT
Converts an int to Text using its String representation.
-
-
Constructor Details
-
IntSliderOption
public IntSliderOption(String key, int initialValue, IntConsumer setter, IntFunction<net.minecraft.text.Text> valueToText, int min, int max, int step, net.minecraft.client.option.SimpleOption.TooltipFactory<Integer> tooltipFactory) Creates a slider option.- Parameters:
key- The translation keyinitialValue- The initial valuesetter- The callback for the modified valuevalueToText- The function that converts the value to human-readable textmin- The minimum valuemax- The maximum valuestep- The step between each valuetooltipFactory- The tooltip factory
-
IntSliderOption
public IntSliderOption(String key, int initialValue, IntConsumer setter, IntFunction<net.minecraft.text.Text> valueToText, int min, int max, int step) Creates a slider option, with no tooltip.- Parameters:
key- The translation keyinitialValue- The initial valuesetter- The callback for the modified valuevalueToText- The function that converts the value to human-readable textmin- The minimum valuemax- The maximum valuestep- The step between each value
-
IntSliderOption
public IntSliderOption(String key, int initialValue, IntConsumer setter, IntFunction<net.minecraft.text.Text> valueToText, int min, int max) Creates a slider option, with no step or tooltip.- Parameters:
key- The translation keyinitialValue- The initial valuesetter- The callback for the modified valuevalueToText- The function that converts the value to human-readable textmin- The minimum valuemax- The maximum value
-
-
Method Details
-
createWidget
public net.minecraft.client.gui.widget.ClickableWidget createWidget(int x, int y, int width, int height) Description copied from interface:WidgetCreatorCreates the widget.- Specified by:
createWidgetin interfaceWidgetCreator- Parameters:
x- The x positiony- The y positionwidth- The widget widthheight- The widget height- Returns:
- The created widget
-