Package net.uku3lig.ukulib.config.option
Class SimpleButton
java.lang.Object
net.uku3lig.ukulib.config.option.SimpleButton
- All Implemented Interfaces:
WidgetCreator
A simple button that does something when pressed.
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleButton(String key, net.minecraft.client.gui.widget.ButtonWidget.PressAction action) Creates a simple translated button.SimpleButton(net.minecraft.text.Text text, net.minecraft.client.gui.widget.ButtonWidget.PressAction action) Creates a simple button.SimpleButton(net.minecraft.text.Text text, net.minecraft.client.gui.widget.ButtonWidget.PressAction action, boolean active) Creates a simple button. -
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
-
Constructor Details
-
SimpleButton
public SimpleButton(net.minecraft.text.Text text, net.minecraft.client.gui.widget.ButtonWidget.PressAction action, boolean active) Creates a simple button.- Parameters:
text- The text to be displayedaction- The action to run when clickedactive- Whether the button can be clicked
-
SimpleButton
public SimpleButton(net.minecraft.text.Text text, net.minecraft.client.gui.widget.ButtonWidget.PressAction action) Creates a simple button.- Parameters:
text- The text to be displayedaction- The action to run when clicked
-
SimpleButton
Creates a simple translated button.- Parameters:
key- The translation key of the textaction- The action to run when clicked
-
-
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
-