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.components.Button.OnPress action) Creates a simple translated button.SimpleButton(net.minecraft.network.chat.Component text, net.minecraft.client.gui.components.Button.OnPress action) Creates a simple button.SimpleButton(net.minecraft.network.chat.Component text, net.minecraft.client.gui.components.Button.OnPress action, boolean active) Creates a simple button. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.client.gui.components.AbstractWidgetcreateWidget(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
createWidget, wide
-
Constructor Details
-
SimpleButton
public SimpleButton(net.minecraft.network.chat.Component text, net.minecraft.client.gui.components.Button.OnPress 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.network.chat.Component text, net.minecraft.client.gui.components.Button.OnPress 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.components.AbstractWidget 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
-