Class SimpleButton

java.lang.Object
net.uku3lig.ukulib.config.option.SimpleButton
All Implemented Interfaces:
WidgetCreator

public class SimpleButton extends Object implements WidgetCreator
A simple button that does something when pressed.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SimpleButton(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.
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.client.gui.widget.ClickableWidget
    createWidget(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, wait
  • Constructor Details

    • 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 displayed
      action - The action to run when clicked
    • SimpleButton

      public SimpleButton(String key, net.minecraft.client.gui.widget.ButtonWidget.PressAction action)
      Creates a simple translated button.
      Parameters:
      key - The translation key of the text
      action - 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: WidgetCreator
      Creates the widget.
      Specified by:
      createWidget in interface WidgetCreator
      Parameters:
      x - The x position
      y - The y position
      width - The widget width
      height - The widget height
      Returns:
      The created widget