Class BoxWidget

java.lang.Object
net.minecraft.client.gui.GuiComponent
net.minecraft.client.gui.components.AbstractWidget
All Implemented Interfaces:
TickableGuiEventListener, net.minecraft.client.gui.components.events.GuiEventListener, net.minecraft.client.gui.components.Widget, net.minecraft.client.gui.narration.NarratableEntry, net.minecraft.client.gui.narration.NarrationSupplier

public class BoxWidget extends ElementWidget
  • Field Details

    • gradientFactory

      public static final Function<BoxWidget,FadableScreenElement> gradientFactory
    • box

      protected BoxElement box
    • customBorderTop

      @Nullable protected Color customBorderTop
    • customBorderBot

      @Nullable protected Color customBorderBot
    • customBackground

      @Nullable protected Color customBackground
    • disabledTheme

      protected Theme.Key disabledTheme
    • idleTheme

      protected Theme.Key idleTheme
    • hoverTheme

      protected Theme.Key hoverTheme
    • clickTheme

      protected Theme.Key clickTheme
    • animateColors

      protected boolean animateColors
    • colorAnimation

      protected LerpedFloat colorAnimation
    • gradientColor1

      protected Color gradientColor1
    • gradientColor2

      protected Color gradientColor2
  • Constructor Details

    • BoxWidget

      public BoxWidget()
    • BoxWidget

      public BoxWidget(int x, int y)
    • BoxWidget

      public BoxWidget(int x, int y, int width, int height)
  • Method Details

    • withBounds

      public <T extends BoxWidget> T withBounds(int width, int height)
    • withBorderColors

      public <T extends BoxWidget> T withBorderColors(Couple<Color> colors)
    • withBorderColors

      public <T extends BoxWidget> T withBorderColors(Color top, Color bot)
    • withCustomBackground

      public <T extends BoxWidget> T withCustomBackground(Color color)
    • withThemeKeys

      public <T extends BoxWidget> T withThemeKeys(@Nullable Theme.Key disabledTheme, @Nullable Theme.Key idleTheme, @Nullable Theme.Key hoverTheme, @Nullable Theme.Key clickTheme)
    • animateColors

      public <T extends BoxWidget> T animateColors(boolean b)
    • tick

      public void tick()
      Specified by:
      tick in interface TickableGuiEventListener
      Overrides:
      tick in class ElementWidget
    • onClick

      public void onClick(double x, double y)
      Overrides:
      onClick in class AbstractSimiWidget
    • beforeRender

      protected void beforeRender(@Nonnull com.mojang.blaze3d.vertex.PoseStack ms, int mouseX, int mouseY, float partialTicks)
      Overrides:
      beforeRender in class ElementWidget
    • renderButton

      public void renderButton(com.mojang.blaze3d.vertex.PoseStack ms, int mouseX, int mouseY, float partialTicks)
      Overrides:
      renderButton in class ElementWidget
    • isMouseOver

      public boolean isMouseOver(double mX, double mY)
      Specified by:
      isMouseOver in interface net.minecraft.client.gui.components.events.GuiEventListener
      Overrides:
      isMouseOver in class net.minecraft.client.gui.components.AbstractWidget
    • getBox

      public BoxElement getBox()
    • updateColorsFromState

      public void updateColorsFromState()
    • animateGradientFromState

      public void animateGradientFromState()
    • getDisabledTheme

      public Theme.Key getDisabledTheme()
    • getIdleTheme

      public Theme.Key getIdleTheme()
    • getHoverTheme

      public Theme.Key getHoverTheme()
    • getClickTheme

      public Theme.Key getClickTheme()