Class ControlsListWidget.CategoryEntry

All Implemented Interfaces:
Element, ParentElement
Enclosing class:
ControlsListWidget

@Environment(CLIENT)
public class ControlsListWidget.CategoryEntry
extends ControlsListWidget.Entry
  • Field Details

    • text

      private final Text text
    • textWidth

      private final int textWidth
  • Constructor Details

    • CategoryEntry

      public CategoryEntry​(Text text)
  • Method Details

    • render

      public void render​(MatrixStack matrices, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean hovered, float tickDelta)
      Renders an entry in a list.
      Specified by:
      render in class EntryListWidget.Entry<ControlsListWidget.Entry>
      Parameters:
      matrices - the matrix stack used for rendering
      index - the index of the entry
      y - the Y coordinate of the entry
      x - the X coordinate of the entry
      entryWidth - the width of the entry
      entryHeight - the height of the entry
      mouseX - the X coordinate of the mouse
      mouseY - the Y coordinate of the mouse
      hovered - whether the mouse is hovering over the entry
    • changeFocus

      public boolean changeFocus​(boolean lookForwards)
      Changes the focusing element by cycling to the next/previous element. This action is done typically when the user has pressed the 'Tab' or 'Ctrl+Tab' key.
      Parameters:
      lookForwards - true to cycle forwards, otherwise cycle backwards
      Returns:
      true to indicate that the event handling is successful/valid
    • children

      public List<? extends Element> children()
      Gets a list of all child GUI elements.