âïļRender
render namespace
Enums
Datatypes
color
render.color(255, 255, 255)
render.color(255, 255, 255, 100)
render.color("#FFFFFF")
r
number
red channel (0-255)
â
g
number
green channel (0-255)
â
b
number
blue channel (0-255)
â
a
number
alpha channel (0-255)
255
hex_code
string
hex color code
Returns:
Table structure:
{ r, g, b, a }
esp_flag
render.esp_flag("some flag", render.color("#FFFFFF"))
Fonts
create_font
render.create_font("smallest_pixel-7.ttf", 11, render.font_flag_outline)
font_path
string
path to font or name of font
â
size
number
font size
â
Returns:
create_font_gdi
render.create_font_gdi("Smallest pixel-7", 11, render.font_flag_outline)
font_path
string
path to font or name of font
â
size
number
font size
â
Returns:
create_font_stream
render.create_font_stream({0x1, ...}, 12)
bytes
table
table of bytes
â
size
number
font size
â
Returns:
get_text_size
render.get_text_size(font, "String to measure")
Returns:
wrap_text
render.wrap_text(font, 'This is a really long string!', 250)
text
string
string to measure
width
number
target text width
Returns:
text
render.text(font, 10, 10, "this is some centered text", render.color("#FFFFFF"), render.align_center, render.align_center, render.align_left)
x
number
first x coord
â
y
number
first y coord
â
text
string
text to draw
â
Pre-defined fonts:
font_gui_main
font_gui_title
font_gui_bold
font_esp
font_esp_name
font_indicator
-- Ex: render.font_gui_main, render.font_esp
Shaders
create_shader
local shader = render.create_shader([[
sampler s0;
float4 main(float2 uv: TEXCOORD0): COLOR0
{
return tex2D(s0, uv);
}
]]);
src
string
shader source code
Supported pre-defined shader parameters:
s0
sampler
current texture
c0
float2
current texture's dimensions
c1
float
current time in seconds
c2
float
current global alpha override
Returns:
set_shader
render.set_shader(shader);
shader_id
number / nil
shader id returned from render.create_shader
Usage:
Sets or resets a shader.
Textures
create_texture
render.create_texture("fatality/image.jpg")
texture_path
string
path to texture
Supported image formats:
JPEG
PNG
BMP
GIF (non-animated)
TGA
PSD
HDR
PIC
PNM (binary only)
Returns:
create_texture_bytes
render.create_texture_bytes(bytes, 20)
Supported Image Formats:
JPEG
PNG
BMP
GIF (non-animated)
TGA
PSD
HDR
PIC
PNM (binary only)
Returns:
Note:
This function can only be used by utilizing the ffi library as it requires a byte array. One way to do such would be using ISteamUtils::GetImageRGBA.
create_texture_rgba
render.create_texture_rgba(bytes, 100, 100, row_stride)
bytes
unsigned char*
array of bytes
w
number
texture width
h
number
texture height
row_stride
number
number of bytes in each row (image width * 4)
Supported Image Formats:
JPEG
PNG
BMP
GIF (non-animated)
TGA
PSD
HDR
PIC
PNM (binary only)
Returns:
Note:
This function can only be used by utilizing the ffi library as it requires a byte array. One way to do such would be using ISteamUtils::GetImageRGBA.
create_texture_stream
render.create_texture_stream({0x1, 0x5, 0xff})
byte_stream
table of bytes
texture bytes
Returns:
create_texture_svg
local svg_data =
[[
<svg style="width:24px;height:24px" viewBox="0 0 24 24">
<path fill="#ffffff" d="M12.89,3L14.85,3.4L11.11,21L9.15,20.6L12.89,3M19.59,12L16,8.41V5.58L22.42,12L16,18.41V15.58L19.59,12M1.58,12L8,5.58V8.41L4.41,12L8,15.58V18.41L1.58,12Z" />
</svg>
]]
render.create_texture_svg(svg_data, 20)
-- or
render.create_texture_svg("fatality/image.svg", 20)
image
string
svg data or svg file path
target_height
number
desired image height
Returns:
push_texture / set_texture
local texture_id = render.create_texture("image.png"
render.set_texture(texture_id)
texture_id
number
texture id returned from render.create_texture
Pre-defined textures:
texture_logo_head
texture_logo_stripes
texture_cursor
texture_loading
texture_icon_up
texture_icon_down
texture_icon_clear
texture_icon_copy
texture_icon_pase
texture_icon_add
texture_icon_search
texture_icon_settings
texture_icon_bug
texture_icon_rage
texture_icon_legit
texture_icon_visuals
texture_icon_misc
texture_icon_scripts
texture_icon_skins
texture_avatar
-- Ex: render.texture_logo_head, render.texture_avatar
Usage:
Sets a texture used by render functions.
pop_texture
render.pop_texture()
Usage:
Pops a previously used texture
push_uv / set_uv
render.set_uv(0.25, 0.25, 0.75, 0.75)
x1
number
min x coord (0 - 1)
y1
number
min y coord (0 - 1)
x2
number
max x coord (0 - 1)
y2
number
max y coord (0 - 1)
Usage:
Adjusts texture coordinates. Use after calling render.push_texture.
pop_uv
render.pop_uv()
Usage:
Pops a previously used set of texture coordinates.
get_texture_size
render.get_texture_size(texture_id)
Returns:
get_frame_count
local framecount = render.get_frame_count(my_gif)
Returns:
This function will return 0 if a texture is NOT an animated GIF.
Drawing
get_screen_size
local w, h = render.get_screen_size()
Returns:
push_clip_rect
render.push_clip_rect(10, 10, 110, 110)
x1
number
min x point
â
y1
number
min y point
â
x2
number
max x point
â
x2
number
max y point
â
intersect
boolean
should it intersect with existing clip rects
false
Usage:
Pushes a clip rect so elements can only be drawn within the rect.
Make sure to follow the call with render.pop_clip_rect!
Failure to do so will result in undefined behavior!
pop_clip_rect
render.pop_clip_rect()
Usage:
Pops a previously used clip rect
rect_filled
render.rect_filled(10, 10, 110, 110, render.color("#00FFFF"))
x1
number
min x point
y1
number
min y point
x2
number
max x point
y2
number
max y point
Usage:
Draws a filled rectangle. Use render.push_texture to apply a texture to the shape.
rect
render.rect(10, 10, 110, 110, render.color("#00FFFF"))
x1
number
min x point
â
y1
number
min y point
â
x2
number
max x point
â
y2
number
max y point
â
thickness
float
thickness of line
1.f
rect_rounded
render.rect_rounded(10, 10, 110, 110, render.color("#00FFFF"), 1.5, render.top)
x1
number
min x point
â
y1
number
min y point
â
x2
number
max x point
â
y2
number
max y point
â
rounding
number
amount of rounding
â
thickness
float
thickness of line
1.f
Usage:
Draws a filled rounded rectangle. Use render.push_texture to apply a texture to the shape.
rect_filled_rounded
render.rect_filled_rounded(10, 10, 110, 110, render.color("#00FFFF"), 1.5, render.top)
x1
number
min x point
â
y1
number
min y point
â
x2
number
max x point
â
y2
number
max y point
â
rounding
number
amount of rounding
â
Usage:
Draws a filled rounded rectangle. Use render.push_texture to apply a texture to the shape.
rect_filled_multicolor
render.rect_filled_multicolor(10, 10, 110, 110,
render.color("#FFFFFF"), render.color("#000000"),
render.color("#FFFFFF"), render.color("#000000"))
x1
number
min x point
y1
number
min y point
x2
number
max x point
y2
number
max y point
Usage:
Draws a multi-color rectangle.
circle_filled
render.circle_filled(110, 110, 50, render.color("#FFFFFF"))
x
number
center x point
â
y
number
center y point
â
radius
number
the circles radius
â
segments
number
number of points (circle resolution)
12
percentage
number
how much of the circle is drawn (0 - 1)
1
angle
number
circle rotation (0 - 360Draws a filled multi-color rectangle.)
0
Usage:
Draws a filled circle. Use render.push_texture to apply a texture to the shape.
circle
render.circle(110, 110, 50, render.color("#FFFFFF"))
x
number
center x point
â
y
number
center y point
â
radius
number
the circles radius
â
thickness
number
thickness of the circle in pixels
1
segments
number
number of points (circle resolution)
12
percentage
number
how much of the circle is drawn (0 - 1)
1
angle
number
circle rotation (0 - 360)
0
line
render.line(10, 10, 100, 100, render.color("#FFFFFF"))
x1
number
first x coord
y1
number
first y coord
x2
number
second x coord
y2
number
second y coord
line_multicolor
render.line_multicolor(10, 10, 100, 100,
render.color("#FFFFFF"), render.color("#000000"))
x1
number
first x coord
y1
number
first y coord
x2
number
second x coord
y2
number
second y coord
triangle_filled
render.triangle_filled(20, 10, 5, 20, 30, 20, render.color("#FFFFFF"))
x1
number
first x coord
y1
number
first y coord
x2
number
second x coord
y2
number
second y coord
x3
number
third x coord
y3
number
third y coord
Usage:
Draws a filled triangle. Use render.push_texture to apply a texture to the shape.
triangle
render.triangle(20, 10, 5, 20, 30, 20, render.color("#FFFFFF"))
x1
number
first x coord
y1
number
first y coord
x2
number
second x coord
y2
number
second y coord
x3
number
third x coord
y3
number
third y coord
triangle_filled_multicolor
render.triangle_filled_multicolor(20, 10, 5, 20, 30, 20,
render.color("#FF0000"), render.color("#00FF00"), render.color("#0000FF"))
x1
number
first x coord
y1
number
first y coord
x2
number
second x coord
y2
number
second y coord
x3
number
third x coord
y3
number
third y coord
Animations
create_animator_float
render.create_animator_float(0, 5, render.ease_in_out)
duration
number
how long to take in seconds
â
Returns:
create_animator_color
render.create_animator_color(render.color("FFFFFF"), 5, render.ease_in_out, true)
duration
number
how long to take in seconds
â
interpolate_hue
boolean
should the hue be animated
false
Returns:
Last updated