Skip to content

renderer

Methods

get_screen_size(): number, number

Returns screen width and height

1
local w, h = engine_client.get_screen_size()

line(from_x, from_y, to_x, to_y, col)

Type Name Description Default
number from_x Start X none
number from_y Start Y none
number to_x End X none
number to_y End Y none
color col Color none

Draws a line in the given color between the two given points.

1
renderer.line(50, 50, 150, 150, color.new(255, 255, 255))

rect(from_x, from_y, to_x, to_y, col)

Type Name Description Default
number from_x Start X none
number from_y Start Y none
number to_x End X none
number to_y End Y none
color col Color none

Draws a rectangle (not filled) between the two given points.

1
renderer.rect(50, 50, 150, 150, color.new(255, 255, 255))

rect_filled(from_x, from_y, to_x, to_y, col)

Type Name Description Default
number from_x Start X none
number from_y Start Y none
number to_x End X none
number to_y End Y none
color col Color none

Draws a rectangle (filled) between the two given points.

1
renderer.rect_filled(50, 50, 150, 150, color.new(255, 255, 255))

rect_filled_fade(from_x, from_y, to_x, to_y, col0, col1, is_horizontal)

Type Name Description Default
number from_x Start X none
number from_y Start Y none
number to_x End X none
number to_y End Y none
color col0 From color none
color col1 To color none
bool is_horizontal Changes gradient direction none

Draws a filled gradient rectangle between the two given points.

1
renderer.rect_filled_fade(50, 50, 150, 150, color.new(0, 0, 0), color.new(255, 255, 255), true)

circle(x, y, radius, col, progress, filled)

Type Name Description Default
number x Center X none
number y Center Y none
number radius Circle radius none
color col Color none
number progress How much to fill (0.0-1.0, ex: 0.25 = 1/4 circle) none
bool filled Outlined or filled circle none

Draws a circle

1
renderer.circle(50, 50, 12, color.new(255, 255, 255), 1.0, true)

logo(x, y, col, small)

Type Name Description Default
number x X position none
number y Y position none
color col Logo accent color none
bool small Should be small or not false

Draws ev0lve logo

1
renderer.logo(50, 50, color.new(239, 9, 95))

icon(x, y, col, icon, height)

Type Name Description Default
number x X position none
number y Y position none
color col Icon color none
string icon Icon to draw none
number height Height of icon none

Draws icon from game resources

1
renderer.icon(5, 5, color.new(255, 255, 255), 'hud/deathnotice/icon_headshot', 20)

weapon(x, y, col, wep, height)

Type Name Description Default
number x X position none
number y Y position none
color col Icon color none
string wep Weapon icon to draw none
number height Height of weapon icon none

Draws weapon icon

1
renderer.weapon(5, 5, color.new(255, 255, 255), 'ak47', 20)

get_icon_width(icon, height): number

Type Name Description Default
string icon Icon none
number height Height of icon none

Returns width of icon

1
local w = renderer.get_icon_width('hud/deathnotice/icon_headshot', 20)

get_weapon_width(wep, height): number

Type Name Description Default
string wep Weapon icon none
number height Height of icon none

Returns width of weapon icon

1
local w = renderer.get_weapon_width('ak47', 20)

text(x, y, col, text, font, align_horiz, align_vert)

Type Name Description Default
number x X position none
number y Y position none
color col Color none
string text Text none
fonts font Font definition none
number align_horiz Horizontal alignment (0 = left, 1 = center, 2 = right) 0
number align_vert Vertical alignment (0 = top, 1 = center, 2 = bottom) 0

Draws text on screen.

1
renderer.text(50, 50, color.new(255, 255, 255), 'Hello world!', fonts.default)

get_text_size(text, font): number, number

Type Name Description Default
string text Text none
fonts font Font definition none

Returns width and height of text

1
local w, h = renderer.get_text_size('ev0lve.xyz', fonts.default)

new_font(name, font, size, weight, flags, low, high): font

Type Name Description Default
string name Name that will be used to identify your font none
string font System font name none
number size Size in pixels none
number weight How wide font should be (300 - thin, 500 - default, 700 - bold) none
number/flag flags Font flags (fontflags) none
number low Glyph range min 0
number high Glyph range max 0

Creates new font object. Font will be accessible via fonts like this: fonts.YOUR_NAME

1
renderer.new_font('my_font', 'Arial', 24, 500, fontflags.none)

world_to_screen(world): number, number

Type Name Description Default
vec3 world World position none

Translates world point into screen point (returns x, y on screen or -1, -1 if not on screen)

1
local x, y = renderer.world_to_screen(entity_origin)