类 ScrollPanel

所有已实现的接口:
ContainerEventHandler, GuiEventListener, Renderable, TabOrderedElement, NarratableEntry, NarrationSupplier
直接已知子类:
ModListScreen.InfoPanel, ModMismatchDisconnectedScreen.MismatchInfoPanel

public abstract class ScrollPanel extends AbstractContainerEventHandler implements Renderable, NarratableEntry
Abstract scroll panel class.
  • 字段详细资料

    • client

      private final Minecraft client
    • width

      protected final int width
    • height

      protected final int height
    • top

      protected final int top
    • bottom

      protected final int bottom
    • left

      protected final int left
    • scrolling

      private boolean scrolling
    • scrollDistance

      protected float scrollDistance
    • captureMouse

      protected boolean captureMouse
    • border

      protected final int border
    • barWidth

      private final int barWidth
    • barLeft

      private final int barLeft
    • bgColorFrom

      private final int bgColorFrom
    • bgColorTo

      private final int bgColorTo
    • barBgColor

      private final int barBgColor
    • barColor

      private final int barColor
    • barBorderColor

      private final int barBorderColor
  • 构造器详细资料

    • ScrollPanel

      public ScrollPanel(Minecraft client, int width, int height, int top, int left)
      参数:
      client - the minecraft instance this ScrollPanel should use
      width - the width
      height - the height
      top - the offset from the top (y coord)
      left - the offset from the left (x coord)
    • ScrollPanel

      public ScrollPanel(Minecraft client, int width, int height, int top, int left, int border)
      参数:
      client - the minecraft instance this ScrollPanel should use
      width - the width
      height - the height
      top - the offset from the top (y coord)
      left - the offset from the left (x coord)
      border - the size of the border
    • ScrollPanel

      public ScrollPanel(Minecraft client, int width, int height, int top, int left, int border, int barWidth)
      参数:
      client - the minecraft instance this ScrollPanel should use
      width - the width
      height - the height
      top - the offset from the top (y coord)
      left - the offset from the left (x coord)
      border - the size of the border
      barWidth - the width of the scroll bar
    • ScrollPanel

      public ScrollPanel(Minecraft client, int width, int height, int top, int left, int border, int barWidth, int bgColor)
      参数:
      client - the minecraft instance this ScrollPanel should use
      width - the width
      height - the height
      top - the offset from the top (y coord)
      left - the offset from the left (x coord)
      border - the size of the border
      barWidth - the width of the scroll bar
      bgColor - the color for the background
    • ScrollPanel

      public ScrollPanel(Minecraft client, int width, int height, int top, int left, int border, int barWidth, int bgColorFrom, int bgColorTo)
      参数:
      client - the minecraft instance this ScrollPanel should use
      width - the width
      height - the height
      top - the offset from the top (y coord)
      left - the offset from the left (x coord)
      border - the size of the border
      barWidth - the width of the scroll bar
      bgColorFrom - the start color for the background gradient
      bgColorTo - the end color for the background gradient
    • ScrollPanel

      public ScrollPanel(Minecraft client, int width, int height, int top, int left, int border, int barWidth, int bgColorFrom, int bgColorTo, int barBgColor, int barColor, int barBorderColor)
      Base constructor
      参数:
      client - the minecraft instance this ScrollPanel should use
      width - the width
      height - the height
      top - the offset from the top (y coord)
      left - the offset from the left (x coord)
      border - the size of the border
      barWidth - the width of the scroll bar
      bgColorFrom - the start color for the background gradient
      bgColorTo - the end color for the background gradient
      barBgColor - the color for the scroll bar background
      barColor - the color for the scroll bar handle
      barBorderColor - the border color for the scroll bar handle
  • 方法详细资料

    • getContentHeight

      protected abstract int getContentHeight()
    • drawBackground

      protected void drawBackground(GuiGraphics guiGraphics, Tesselator tess, float partialTick)
      Draws the background of the scroll panel. This runs AFTER Scissors are enabled.
    • drawPanel

      protected abstract void drawPanel(GuiGraphics guiGraphics, int entryRight, int relativeY, Tesselator tess, int mouseX, int mouseY)
      Draw anything special on the screen. Scissor (RenderSystem.enableScissor) is enabled for anything that is rendered outside the view box. Do not mess with Scissor unless you support this.
    • clickPanel

      protected boolean clickPanel(double mouseX, double mouseY, int button)
    • getMaxScroll

      private int getMaxScroll()
    • applyScrollLimits

      private void applyScrollLimits()
    • mouseScrolled

      public boolean mouseScrolled(double mouseX, double mouseY, double deltaX, double deltaY)
      指定者:
      mouseScrolled 在接口中 ContainerEventHandler
      指定者:
      mouseScrolled 在接口中 GuiEventListener
    • getScrollAmount

      protected int getScrollAmount()
    • isMouseOver

      public boolean isMouseOver(double mouseX, double mouseY)
      指定者:
      isMouseOver 在接口中 GuiEventListener
    • mouseClicked

      public boolean mouseClicked(double mouseX, double mouseY, int button)
      指定者:
      mouseClicked 在接口中 ContainerEventHandler
      指定者:
      mouseClicked 在接口中 GuiEventListener
    • mouseReleased

      public boolean mouseReleased(double mouseX, double mouseY, int button)
      指定者:
      mouseReleased 在接口中 ContainerEventHandler
      指定者:
      mouseReleased 在接口中 GuiEventListener
    • getBarHeight

      private int getBarHeight()
    • mouseDragged

      public boolean mouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY)
      指定者:
      mouseDragged 在接口中 ContainerEventHandler
      指定者:
      mouseDragged 在接口中 GuiEventListener
    • render

      public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick)
      指定者:
      render 在接口中 Renderable
    • drawGradientRect

      protected void drawGradientRect(GuiGraphics guiGraphics, int left, int top, int right, int bottom, int color1, int color2)
    • children

      public List<? extends GuiEventListener> children()
      指定者:
      children 在接口中 ContainerEventHandler