render/immediate

Contains non-recommended rendering functions for immediate rendering

## USAGE NOT RECOMMENDED ##
Please refer to render.batched for proper rendering unless you want to use minecraft font!

rect()

Renders a rectangle at the given position with the given boundaries and color

rect(x: float, y: float, width: float, height: float, color: int): void

Parameters

nametypedescription
xfloatThe x position
yfloatThe y position
widthfloatThe width
heightfloatThe height
colorintThe color

gradient_rect()

Renders a gradient rectangle at the given position with the given boundaries and colors

gradient_rect(x: float, y: float, width: float, height: float, from: int, to: int, vertical: boolean): void

Parameters

nametypedescription
xfloatThe x position
yfloatThe y position
widthfloatThe width
heightfloatThe height
fromintThe from color
tointThe to color
verticalbooleanWhether the gradient should be vertical or horizontal

rounded_rect()

Renders a rounded rectangle at the given position with the given boundaries, radius and color

rounded_rect(x: float, y: float, width: float, height: float, radius: float, color: int): void

Parameters

nametypedescription
xfloatThe x position
yfloatThe y position
widthfloatThe width
heightfloatThe height
radiusfloatThe corner radius
colorintThe color

outline_rounded_rect()

Renders an outlined rounded rectangle at the given position with the given boundaries, radius, thickness and color

outline_rounded_rect(x: float, y: float, width: float, height: float, radius: float, thickness: float, color: int): void

Parameters

nametypedescription
xfloatThe x position
yfloatThe y position
widthfloatThe width
heightfloatThe height
radiusfloatThe corner radius
thicknessfloatThe thickness of the outline
colorintThe color

triangle()

Renders a triangle at the given position with the given color

triangle(top_x: float, top_y: float, left_x: float, left_y: float, right_x: float, right_y: float, color: int): void

Parameters

nametypedescription
top_xfloatThe top x of the triangle
top_yfloatThe top y of the triangle
left_xfloatThe left x of the triangle
left_yfloatThe left y of the triangle
right_xfloatThe right x of the triangle
right_yfloatThe right y of the triangle
colorintThe color

minecraft_text()

Renders a text with the minecraft font at the given position

minecraft_text(text: string, x: float, y: float, color: int, shadow: boolean): void

Parameters

nametypedescription
textstringThe text to be rendered
xfloatThe x position
yfloatThe y position
colorintThe color
shadowbooleanWhether to apply a drop-shadow or not

text()

text(font_type: customfonttype, text: string, size: float, x: float, y: float, color: int, shadow: boolean): void

Parameters

nametypedescription
font_typecustomfonttypeThe type of font to render the text with
textstringThe text to be rendered
sizefloatThe font size to use
xfloatThe x position
yfloatThe y position
colorintThe color
shadowbooleanWhether to apply a drop-shadow or not