RenderUtil

object RenderUtil

Render utils for DrawContext to provide functionality similar to 1.20.2+ sprite rendering

Author

fzzyhmstrs

Since

0.2.0

Types

Link copied to clipboard
class Background(val outerWidth: Int, val outerHeight: Int, val width: Int, val height: Int)

Functions

Link copied to clipboard
fun addBackground(id: Identifier, background: RenderUtil.Background)
Link copied to clipboard
fun DrawContext.drawNineSlice(id: Identifier, x: Int, y: Int, width: Int, height: Int)
fun DrawContext.drawNineSlice(id: Identifier, x: Int, y: Int, width: Int, height: Int, outerWidth: Int, outerHeight: Int, textureWidth: Int, textureHeight: Int)

Extension function to replicate the nine-slice functionality drawGuiTexture from 1.20.2+. Will brute force render the texture passed as a "standard" texture by adding the necessary identifier path information (such as the .png).

fun DrawContext.drawNineSlice(id: Identifier, x: Int, y: Int, width: Int, height: Int, alpha: Float)
fun DrawContext.drawNineSlice(id: Identifier, x: Int, y: Int, width: Int, height: Int, color: Int)

Extension function to replicate the nine-slice functionality drawGuiTexture from 1.20.2+.

Link copied to clipboard
fun DrawContext.drawTex(id: Identifier, x: Int, y: Int, width: Int, height: Int)

Extension function to replicate drawGuiTexture from 1.20.2+. Will brute force render the texture passed as a "standard" texture by adding the necessary identifier path information (such as the .png).

fun DrawContext.drawTex(id: Identifier, x: Int, y: Int, width: Int, height: Int, alpha: Float)
fun DrawContext.drawTex(id: Identifier, x: Int, y: Int, width: Int, height: Int, color: Int)

Extension function to replicate drawGuiTexture from 1.20.2-1.21.1.

fun DrawContext.drawTex(id: Identifier, x: Int, y: Int, u: Float, v: Float, width: Int, height: Int, texWidth: Int, texHeight: Int)

Extension function to draw a texture, replacing drawtexture.

Link copied to clipboard
Link copied to clipboard
fun renderBlur(context: DrawContext, x: Float, y: Float, delta: Float)

Applies the blur shader to the current drawn elements. This is used to blur stuff behind guis, but can be used for whatever else.