Interface RenderContext
@Environment(CLIENT)
public interface RenderContext
Parameters of
PreviewRenderer.draw(RenderContext).- Since:
- 5.4.0
-
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.client.gui.Fontfont()The text renderer.net.minecraft.client.gui.GuiGraphicsExtractorgraphics()Context about the current matrices and more.intmouseX()The X position of the mouse cursor, relative to the current active Screen.intmouseY()The Y position of the mouse cursor, relative to the current active Screen.intX position of the tooltip's upper-right corner.intY position of the tooltip's upper-right corner.intNumber of pixels available for rendering the preview in the Y axis.intNumber of pixels available for rendering the preview in the X axis.intx()X position of the preview's upper-right corner.inty()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
-