2D renderer

getWindowScale()

Return minecraft window scale.

Returns:

  • (table) (width, height)

Example Usage:

-- Example code showing how to use the function
register2DRenderer(function(context)
    local scale = context.getWindowScale()
    local width = scale.width -- Number
    local height = scale.height -- Number
end)

getTextWidth(str)

raws a 2D text.

Parameters:

  • object (table (x, y, red, green, blue, text))

Returns:

  • (number)

Example Usage:

renderText(object)

Draws a 2D text.

Parameters:

  • object (table (x, y, red, green, blue, text))

Returns:

  • (boolean) Return true if successfully

Example Usage:

renderImage(object)

Draws a 2D text.

Parameters:

  • object (table (x, y, path, width, height))

Returns:

  • (boolean) Return true if successfully

Example Usage:

renderRect(object)

Draws a 2D rectangle.

Parameters:

  • object (table (x, y, width, height, red, green, blue, alpha))

Returns:

  • (boolean) Return true if successfully

Example Usage:

renderLine(object)

Draws a 2D line.

Parameters:

  • object (table)

Returns:

  • (boolean) Return true if successfully

Example Usage:

renderPolygon(object)

Draws a 2D rectangle.

Parameters:

  • object (table)

Returns:

  • (boolean) Return true if successfully

Example Usage:

renderItemStack(object)

Draws a 2D Item.

Parameters:

  • object (table)

Returns:

  • (boolean) Return true if successfully

Example Usage:

Last updated