Class AbstractButton

java.lang.Object
net.minecraft.client.gui.components.AbstractWidget
net.minecraft.client.gui.components.AbstractButton
All Implemented Interfaces:
GuiEventListener, Renderable, TabOrderedElement, LayoutElement, NarratableEntry, NarrationSupplier, IAbstractWidgetExtension
Direct Known Subclasses:
BeaconScreen.BeaconScreenButton, Button, Checkbox, CycleButton

public abstract class AbstractButton extends AbstractWidget
  • Field Details

  • Constructor Details

    • AbstractButton

      public AbstractButton(int pX, int pY, int pWidth, int pHeight, Component pMessage)
  • Method Details

    • onPress

      public abstract void onPress()
    • renderWidget

      protected void renderWidget(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick)
      Specified by:
      renderWidget in class AbstractWidget
    • renderString

      public void renderString(GuiGraphics pGuiGraphics, Font pFont, int pColor)
    • onClick

      public void onClick(double pMouseX, double pMouseY)
      Overrides:
      onClick in class AbstractWidget
    • keyPressed

      public boolean keyPressed(int pKeyCode, int pScanCode, int pModifiers)
      Called when a keyboard key is pressed within the GUI element.

      Parameters:
      pKeyCode - the key code of the pressed key.
      pScanCode - the scan code of the pressed key.
      pModifiers - the keyboard modifiers.
      Returns:
      true if the event is consumed, false otherwise.