πŸ™οΈrender

Functions:

world_to_screen

render.world_to_screen(position: vector): vector

Name
Type
Description

position

vector

Position in world space

Returns the screen position vector. This can only be called from the on_paint callback.

setup_font

render.setup_font(name: string, size: number, flags: number): FontObject

Name
Type
Description

name

string

Font that will be initialized

size

number

Size of the font

flags

number

fontflags.noantialiasing for anti-aliasing, fontflags.italic for cursive text, fontflags.bold bold text

local font = render.setup_font("Verdana", 12, fontflags.noantialiasing | fontflags.bold)

Returns the FontObject struct or nil on failure.

setup_weapon_font

render.setup_weapon_font(size: number): FontObject

Name
Type
Description

size

number

Size of the font

Returns the FontObject struct or nil on failure.

setup_texture

render.setup_texture(path: string): texture

Name
Type
Description

path

string

Path to the image

Returns the texture or nil on failure.

get_text_size

render.get_text_size(font: FontObject, text: string): vector

Name
Type
Description

font

FontObject

Font

text

string

Text that will be measured

Returns the size of the text.

Structs

πŸ”— FontObject

size

font.size: number

Draw functions

blur

render.blur(x: number, y: number: width: number, height: number, alpha: number)

Name
Type
Description

x

number

X position

y

number

Y position

width

number

Width

height

number

Height

alpha

number

Alpha percentage in the range [0, 255]

line

render.line(x: number, y: number, x2: number, y2: number, color: color, thickness: number)

Name
Type
Description

x

number

X position

y

number

Y position

x2

number

X2 position

y2

number

Y2 position

color

color

Color of the line

thickness

number

Thickness of the line

polygon

render.polygon(color: color, positions: {, ...})

color

color

Color of the polygon

positions

vector

Screen positions

polyline

render.polyline(color: color, closed: boolean, thickness: number, positions: {, ...})

color

color

Color of the polyline

closed

boolean

-

thickness

number

Thickness of the polyline

positions

vector

Screen positions

rect

render.rect(x: number, y: number, width: number, height: number, color: color[, rounding: number])

Name
Type
Description

x

number

X position

y

number

Y position

width

number

Width

height

number

Height

color

color

Color of the rectangle

rounding

number

Optional. Rounding of the rectangle in pixels

rect_filled

render.rect_filled(x: number, y: number, width: number, height: number, color: color[, rounding: number])

Name
Type
Description

x

number

X position

y

number

Y position

width

number

Width

height

number

Height

color

color

Color of the rectangle

rounding

number

Optional. Rounding of the rectangle in pixels

gradient

render.gradient(x: number, y: number, width: number, height: number, first_color: color, second_color[, type: number])

Name
Type
Description

x

number

X position

y

number

Y position

width

number

Width

height

number

Height

first_color

color

First color

second_color

color

Second color

type

number

Optional. 0 - horizontal, 1 - vertical

circle

render.circle(x: number, y: number, points: number, radius: number, color: color)

Name
Type
Description

x

number

X position

y

number

Y position

points

number

Points of the circle

radius

number

Radius of the circle

color

color

Color of the circle

circle_filled

render.circle_filled(x: number, y: number, points: number, radius: number, color: color)

Name
Type
Description

x

number

X position

y

number

Y position

points

number

Points of the circle

radius

number

Radius of the circle

color

color

Color of the circle

glow_circle

render.glow_circle(x: number, y: number, radius: number, color: color)

Name
Type
Description

x

number

X position

y

number

Y position

radius

number

Radius of the circle

color

color

Color of the circle

arc

render.arc(x: number, y: number: radius: number, second_radius: number, min: number, max: number, color: color)

Name
Type
Description

x

number

X position

y

number

Y position

radius

number

Radiusof the circle

second_radius

number

Second radius of the circle

min

number

Minimum value

max

number

Maximum value

color

color

Color of the circle

circle_3d

render.circle_3d(position: vector, radius: number, color: color)

Name
Type
Description

position

vector

Screen position

radius

number

Radius of the circle

color

color

Color of the circle

circle_filled_3d

render.circle_filled_3d(position: vector, radius: number, color: color)

Name
Type
Description

position

vector

Screen position

radius

number

Radius of the circle

color

color

Color of the circle

text

πŸ“Œ Render any text via the :setup_font or :setup_weapon_font function.

render.text(font: FontObject, x: number, y: number, color: color, text: string[, shadow: boolean, outline: boolean])

Name
Type
Description

font

FontObject

Font

x

number

X position

y

number

Y position

color

color

Color of the text

text

string

Text that will be drawn

shadow

boolean

Optional. Text shadow

outline

boolean

Optional. Text outline

text_gradient

πŸ“Œ Render any text via the :setup_font or :setup_weapon_font function.

render.text_gradient(font: FontObject, x: number, y: number, color: color, second_color: color, text: string, smooth: number[, shadow: boolean, outline: boolean])

Name
Type
Description

font

FontObject

Font

x

number

X position

y

number

Y position

color

color

Color of the text

second_color

color

Second color of the text

text

string

Text that will be drawn

smooth

number

Smoothness of the gradient

shadow

boolean

Optional. Text shadow

outline

boolean

Optional. Text outline

image

render.image(texture: texture, x: number, y: number, width: number, height: number, color: color[, rounding: number])

Name
Type
Description

texture

texture

Texture

x

number

X position

y

number

Y position

width

number

Width

height

number

Height

color

color

Color of the image

rounding

number

Optional. Image rounding

rect_shadow

render.rect_shadow(x: number, y: number, width: number, height: number, length: number, color: color[, x_offset: number, y_offset: number])

Name
Type
Description

x

number

X position

y

number

Y position

width

number

Width

height

number

Height

length

number

Shadow length

color

color

Shadow color

x_offset

number

Optional. X offset

y_offset

number

Optional. Y offset

rect_shadow_ex

render.rect_shadow_ex(position: vector_2d, size: vector_2d, rings: number, sbr: vector, length: number, color: color[, x_offset: number, y_offset: number])

Name
Type
Description

position

vector_2d

Shadow position

size

vector_2d

Shadow size

rings

number

Shadow rings

sbr

vector

vector(between_rings: number, per_corner_side: number, between_samples: number)

length

number

Shadow length

color

color

Shadow color

x_offset

number

Optional. X offset

y_offset

number

Optional. Y offset

begin_cliprect

render.begin_cliprect(x: number, y: number, width: number, height: number)

Name
Type
Description

x

number

X position

y

number

Y position

width

number

Width

height

number

Height

Applies the clip region to the given rectangle for all subsequent elements.

end_cliprect

render.end_cliprect()

Discards an early set rectangle clipping region.

Last updated