Class ExtendedButton

All Implemented Interfaces:
GuiEventListener, Widget, NarratableEntry, NarrationSupplier
Direct Known Subclasses:
Slider, UnicodeGlyphButton

public class ExtendedButton extends Button
This class provides a button that fixes several bugs present in the vanilla GuiButton drawing code. The gist of it is that it allows buttons of any size without gaps in the graphics and with the borders drawn properly. It also prevents button text from extending out of the sides of the button by trimming the end of the string and adding an ellipsis.

The code that handles drawing the button is in GuiUtils.
Author:
bspkrs
  • Constructor Details

    • ExtendedButton

      public ExtendedButton(int xPos, int yPos, int width, int height, Component displayString, Button.OnPress handler)
  • Method Details

    • renderButton

      public void renderButton(PoseStack mStack, int mouseX, int mouseY, float partial)
      Draws this button to the screen.
      Overrides:
      renderButton in class Button