Class WSlider


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

  • 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(DrawContext context, int x, int y, int mouseX, int mouseY)
      Description copied from class: WWidget
      Paints this widget.
      Overrides:
      paint in class WWidget
      Parameters:
      context - the draw context
      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)