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.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 Type
    Method
    Description
    net.minecraft.client.gui.components.AbstractWidget
    createWidget(int x, int y, int width, int height)
    Creates the widget.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface 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 displayed
      action - The action to run when clicked
      active - 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 displayed
      action - The action to run when clicked
    • SimpleButton

      public SimpleButton(String key, net.minecraft.client.gui.components.Button.OnPress 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.components.AbstractWidget 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