Interface RenderContext


@Environment(CLIENT) public interface RenderContext
Since:
5.4.0
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.client.gui.Font
    The text renderer.
    net.minecraft.client.gui.GuiGraphicsExtractor
    Context about the current matrices and more.
    int
    The X position of the mouse cursor, relative to the current active Screen.
    int
    The Y position of the mouse cursor, relative to the current active Screen.
    int
    X position of the tooltip's upper-right corner.
    int
    Y position of the tooltip's upper-right corner.
    int
    Number of pixels available for rendering the preview in the Y axis.
    int
    Number of pixels available for rendering the preview in the X axis.
    int
    x()
    X position of the preview's upper-right corner.
    int
    y()
    Y position of the preview's upper-right corner.
  • Method Details

    • x

      int x()
      X position of the preview's upper-right corner.
      Returns:
      X position.
      Since:
      5.4.0
    • y

      int y()
      Y position of the preview's upper-right corner.
      Returns:
      Y position.
      Since:
      5.4.0
    • viewportWidth

      int viewportWidth()
      Number of pixels available for rendering the preview in the X axis.
      Returns:
      viewport width.
      Since:
      5.4.0
    • viewportHeight

      int viewportHeight()
      Number of pixels available for rendering the preview in the Y axis.
      Returns:
      viewport height.
      Since:
      5.4.0
    • graphics

      @Nonnull net.minecraft.client.gui.GuiGraphicsExtractor graphics()
      Context about the current matrices and more.
      Returns:
      GUI graphics extractor instance.
      Since:
      5.4.0
    • font

      @Nonnull net.minecraft.client.gui.Font font()
      The text renderer.
      Returns:
      Font renderer instance.
      Since:
      5.4.0
    • mouseX

      int mouseX()
      The X position of the mouse cursor, relative to the current active Screen.
      Returns:
      Mouse X position.
      Since:
      5.4.0
    • mouseY

      int mouseY()
      The Y position of the mouse cursor, relative to the current active Screen.
      Returns:
      Mouse Y position.
      Since:
      5.4.0
    • tooltipTopX

      int tooltipTopX()
      X position of the tooltip's upper-right corner.
      Returns:
      Top X position.
      Since:
      5.4.0
    • tooltipTopY

      int tooltipTopY()
      Y position of the tooltip's upper-right corner.
      Returns:
      Top Y position.
      Since:
      5.4.0