drawNineSlice

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).

This method is surely not very efficient. It is designed to be a porting feature.

Author

fzzyhmstrs

Since

0.2.0

Parameters

id

Identier - The sprite identifier (1.20.2+ style) for the image.

x

Int - the x location of the texture

y

Int - the y location of the texture

width

Int - the width of the drawn texture

height

Int - the height of the drawn texture

outerWidth

Int - the width in pixels of the left and right nine-slice borders

outerHeight

Int - the height in pixels of the top and bottom nine-slice borders

textureWidth

Int - the width of the png texture to be tiled

textureHeight

Int - the height of the png texture to be tiled