Class WSlider


public class WSlider extends WAbstractSlider
A simple slider widget that can be used to select int values.
See Also:
  • Field Details

    • TRACK_WIDTH

      public static final int TRACK_WIDTH
      See Also:
    • THUMB_SIZE

      public static final int THUMB_SIZE
      See Also:
    • LIGHT_TEXTURE

      public static final net.minecraft.util.Identifier LIGHT_TEXTURE
    • DARK_TEXTURE

      public static final net.minecraft.util.Identifier DARK_TEXTURE
  • Constructor Details

    • WSlider

      public WSlider(int min, int max, Axis axis)
  • Method Details

    • getThumbWidth

      protected int getThumbWidth()
      Description copied from class: WAbstractSlider
      Returns the thumb size along the slider axis.
      Specified by:
      getThumbWidth in class WAbstractSlider
      Returns:
      the thumb size along the slider axis
    • isMouseInsideBounds

      protected boolean isMouseInsideBounds(int x, int y)
      Description copied from class: WAbstractSlider
      Checks if the mouse cursor is close enough to the slider that the user can start dragging.
      Specified by:
      isMouseInsideBounds in class WAbstractSlider
      Parameters:
      x - the mouse x position
      y - the mouse y position
      Returns:
      if the cursor is inside dragging bounds
    • paint

      @Environment(CLIENT) public void paint(net.minecraft.client.util.math.MatrixStack matrices, int x, int y, int mouseX, int mouseY)
      Description copied from class: WWidget
      Paints this widget.
      Overrides:
      paint in class WWidget
      Parameters:
      matrices - the rendering matrix stack
      x - this widget's X coordinate on the screen
      y - this widget's Y coordinate on the screen
      mouseX - the X coordinate of the cursor
      mouseY - the X coordinate of the cursor
    • getBackgroundPainter

      @Environment(CLIENT) @Nullable public @Nullable BackgroundPainter getBackgroundPainter()
    • setBackgroundPainter

      @Environment(CLIENT) public void setBackgroundPainter(@Nullable @Nullable BackgroundPainter backgroundPainter)