All Implemented Interfaces:
TParentElement, ITooltipProvider, IEnableStateProvider, IEnableStateProviderSetter, ITextProvider, ITextProviderSetter
Direct Known Subclasses:
TScrollBarWidget

public class TSliderWidget extends TButtonWidget
  • Field Details

    • sliderDirection

      protected Direction2D sliderDirection
    • value

      protected double value
    • knobSize

      protected int knobSize
  • Constructor Details

    • TSliderWidget

      public TSliderWidget(int x, int y, int width, int height, double value)
    • TSliderWidget

      public TSliderWidget(int x, int y, int width, int height, net.minecraft.text.Text text, double value)
  • Method Details

    • getSliderDirection

      public final Direction2D getSliderDirection()
    • setSliderDirection

      public void setSliderDirection(Direction2D direction)
    • getValue

      public final double getValue()
    • setValue

      public final void setValue(double value)
    • setValue

      public void setValue(double value, boolean applyValue)
    • setValueFromMouse

      public final void setValueFromMouse(double mouseX, double mouseY)
    • getKnobSize

      public final int getKnobSize()
    • setKnobSize

      public void setKnobSize(int size)
    • render

      public void render(TDrawContext pencil)
      Description copied from interface: TParentElement
      Renders this GUI element on the screen.
      Specified by:
      render in interface TParentElement
      Overrides:
      render in class TButtonWidget
      Parameters:
      pencil - The TDrawContext.
    • renderSliderProgressBar

      public void renderSliderProgressBar(TDrawContext pencil)
      Draws a progress bar that is used as the visual slider value indicator.
      Another primary use for this is this being the getSliderDirection() indicator.
      Parameters:
      pencil - The TDrawContext.
    • renderSliderKnob

      public final void renderSliderKnob(TDrawContext pencil)
      Draws the dragabble little knob that is used as the visual slider value indicator.
      Parameters:
      pencil - The TDrawContext.
    • renderSliderKnob

      public void renderSliderKnob(TDrawContext pencil, int knobX, int knobY, int knobWidth, int knobHeight)
      Draws the dragabble little knob that is used as the visual slider value indicator.
      Parameters:
      pencil - The TDrawContext.
      knobX - The knob X position.
      knobY - The knob Y position.
      knobWidth - The knob size width.
      knobHeight - The knob size height.
    • input

      public boolean input(TInputContext inputContext)
      Description copied from interface: TParentElement
      An input handler that handles inputs on the TInputContext.InputDiscoveryPhase.MAIN input phase.
      Specified by:
      input in interface TParentElement
      Overrides:
      input in class TClickableWidget
      Parameters:
      inputContext - The TInputContext containing information about a given input.
      See Also: