Classes
c_renderer

c_renderer

Functions

⚠️

Renderer functions should only be called from render callback

line

ArgumentTypeRequired
start_posvec2+
end_posvec2+
colorcolor+
thicknessnumber+
local target = features.target_selector:get_default_target()
 
local local_on_screen = g_local.position:to_screen()
local target_on_screen = target.position:to_screen()
 
if target_on_screen ~= nil and local_on_screen ~= nil then
    -- Draw line from local to current target
    g_render:line(local_on_screen, target_on_screen, color:new(255, 255, 255, 255), 1)
end

line_3d

⚠️

This function can have a big impact on fps when called too often.

ArgumentTypeRequired
start_posvec3+
end_posvec3+
colorcolor+
thicknessnumber+
local target = features.target_selector:get_default_target()
 
if target ~= nil and g_local ~= nil then
    -- Draw line from local to current target
    g_render:line_3d(g_local.position, target.position, color:new(255, 255, 255, 255), 1)
end

box

ArgumentTypeRequired
startvec2+
sizevec2+
colorcolor+
roundingnumber+
thicknessnumber+

filled_box

ArgumentTypeRequired
startvec2+
sizevec2+
colorcolor+
roundingnumber+

circle

ArgumentTypeRequired
positionvec2+
colorcolor+
radiusnumber+
segmentsnumber+

filled_circle

ArgumentTypeRequired
positionvec2+
colorcolor+
radiusnumber+
segmentsnumber+

circle_3d

⚠️

This function can have a big impact on fps when called too often.

ArgumentTypeRequired
positionvec3+
colorcolor+
radiusnumber+
flagsnumber+
segmentsnumber+
thicknessnumber+
local target = features.target_selector:get_default_target()
 
if target ~= nil and g_local ~= nil then
    --[[ Draw circle around current target
        flags:
            1 - filled circle
            2 - outlined circle
            4 - filled circle with outline
    ]]
    g_render:circle_3d(target.position, color:new(255, 255, 255), 50, 2, 100, 1)
end

triangle

ArgumentTypeRequired
leftvec2+
rightvec2+
bottomvec2+
colorcolor+
thicknessnumber+

filled_triangle

ArgumentTypeRequired
leftvec2+
rightvec2+
bottomvec2+
colorcolor+

load_texture_from_file

ArgumentTypeRequired
file_pathstring+
local texture = g_render:load_texture_from_file("C:\\Users\\user\\Desktop\\texture.png")
 
if texture ~= nil then
    g_render:image(vec2:new(50, 50), vec2:new(200, 200), texture)
end

image

ArgumentTypeRequired
positionvec2+
sizevec2+
texturetexture_t+
local texture = g_render:load_texture_from_file("C:\\Users\\user\\Desktop\\texture.png")
 
if texture ~= nil then
    g_render:image(vec2:new(50, 50), vec2:new(200, 200), texture)
end

get_screensize

ArgumentTypeRequired
returnsvec2
local size = g_render:get_screensize()
 
print("Screen size: " .. size.x .. "x" .. size.y)

circle_minimap

ArgumentTypeRequired
positionvec3+
colorcolor+
radiusnumber+
segmentsnumber-
thicknessnumber-
-- Draw cicle on minimap at local player position
g_render:cicle_minimap(g_local.position, color:new(255, 255, 255), 15)

text

ArgumentTypeRequired
positionvec2+
colorcolor+
textstring+
fontstring+
sizenumber+
-- uses fallback font when font = nil or not found
g_render:text(vec2:new(50, 50), color:new(255, 255, 255), "Hello world!", nil, 20)

get_text_size

ArgumentTypeRequired
textstring+
fontstring+
sizenumber+
local size = g_render:get_text_size("Hello world!", nil, 20)
 
if size ~= nil then
    print("Text size: " .. size.x .. "x" .. size.y)
end