RenderContext

@ApiStatus.NonExtendable
@NullMarked
interface RenderContext(source)

Types

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
abstract fun assertNoScissors()
Link copied to clipboard
abstract fun clearScissor()
Link copied to clipboard
abstract fun drawColoredRect(left: Float, top: Float, right: Float, bottom: Float, color: Int)
Link copied to clipboard
open fun drawColoredTriangles(colour: Int, coordinates: Array<Float>)
Renders a list of triangles.
Link copied to clipboard
abstract fun drawColouredQuads(colour: Int, coordinates: Array<Float>)
Link copied to clipboard
Link copied to clipboard
open fun drawDarkRect(x: Int, y: Int, width: Int, height: Int)
abstract fun drawDarkRect(x: Int, y: Int, width: Int, height: Int, shadow: Boolean)
Link copied to clipboard
abstract fun drawGradientRect(left: Int, top: Int, right: Int, bottom: Int, startColor: Int, endColor: Int)
Link copied to clipboard
open fun drawHorizontalLine(y: Int, startX: Int, endX: Int, color: Int)
Link copied to clipboard
open fun drawNinePatch(patch: NinePatch<MyResourceLocation>, x: Float, y: Float, width: Int, height: Int)
Link copied to clipboard
abstract fun drawOnTop(layer: Layer, escapeScissors: RenderContext.ScissorBehaviour, later: Consumer<RenderContext>)
draws more content that should be laid on top of other later render calls.
Link copied to clipboard
open fun drawOpenCloseTriangle(isOpen: Boolean, x: Float, y: Float, width: Float, height: Float, color: Int)
Link copied to clipboard
abstract fun drawString(fontRenderer: IFontRenderer, text: StructuredText, x: Int, y: Int, color: Int, shadow: Boolean)
Link copied to clipboard
open fun drawStringCenteredScaledMaxWidth(text: StructuredText, fr: IFontRenderer, x: Float, y: Float, shadow: Boolean, length: Int, color: Int)
Link copied to clipboard
open fun drawStringScaledMaxWidth(text: StructuredText, fontRenderer: IFontRenderer, x: Int, y: Int, shadow: Boolean, width: Int, color: Int)
Link copied to clipboard
open fun drawTexturedRect(texture: MyResourceLocation, x: Float, y: Float, width: Float, height: Float)
Link copied to clipboard
abstract fun drawTexturedTintedRect(texture: MyResourceLocation, x: Float, y: Float, width: Float, height: Float, u1: Float, v1: Float, u2: Float, v2: Float, color: Int, filter: TextureFilter)
Link copied to clipboard
abstract fun drawTooltipNow(x: Int, y: Int, tooltipLines: List<StructuredText>)
Link copied to clipboard
open fun drawVerticalLine(x: Int, startY: Int, endY: Int, color: Int)
Link copied to clipboard
Link copied to clipboard
abstract fun invertedRect(left: Float, top: Float, right: Float, bottom: Float, additiveColor: Int)
Link copied to clipboard
open fun isCmdDown(): Boolean
Link copied to clipboard
open fun isKeyboardKeyDown(keyboardKey: Int): Boolean
Link copied to clipboard
Returns whether the control key is held down on Windows and Linux, and for macOS checks if the command key is held down.
Link copied to clipboard
open fun isMouseButtonDown(mouseButton: Int): Boolean
Link copied to clipboard
Link copied to clipboard
open fun isShiftDown(): Boolean
Link copied to clipboard
abstract fun popMatrix()
Link copied to clipboard
abstract fun popScissor()
Link copied to clipboard
abstract fun pushMatrix()
Link copied to clipboard
abstract fun pushRawScissor(left: Int, top: Int, right: Int, bottom: Int)
push a raw scissor rectangle.
Link copied to clipboard
abstract fun pushScissor(left: Int, top: Int, right: Int, bottom: Int)
push a scissor rectangle, clamped to the current scissor rectangle, relative to the current render position.
Link copied to clipboard
abstract fun renderExtraLayers()
Must be called only by the implementor after all rendering is done.
Link copied to clipboard
abstract fun renderItemStack(itemStack: IItemStack, x: Int, y: Int, @Nullable overlayText: @Nullable StructuredText)
Link copied to clipboard
open fun scale(scalar: Float)
abstract fun scale(x: Float, y: Float)
Link copied to clipboard
open fun scheduleDrawTooltip(x: Int, y: Int, tooltipLines: List<StructuredText>)
Link copied to clipboard
abstract fun translate(x: Float, y: Float)

Inherited functions

fun RenderContext.drawStringCenteredScalingDownWithMaxWidth(text: StructuredText, centerX: Int, centerY: Int, maxWidth: Int, color: Int, shadow: Boolean = false, fr: IFontRenderer = minecraft.defaultFontRenderer)