✏️Render

render namespace

Enums

Font flags

font_flag_shadow

font_flag_outline

Rect rounding

top_left

top_right

bottom_left

bottom_right

top

left

bottom

right

all

Rect outline

outline_inset

outline_outset

outline_center

Text alignment

align_top

align_left

align_center

align_right

align_bottom

Easings
  • linear

  • ease_in

  • ease_out

  • ease_in_out

  • elastic_in

  • elastic_out

  • elastic_in_out

  • bounce_in

  • bounce_out

  • bounce_in_out

Datatypes

color

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 with rgba values

table

Table structure:

esp_flag

text

string

flag to draw

color

color to draw

Fonts

create_font

font_path

string

path to font or name of font

❌

size

number

font size

❌

flags

font flag

0

from

number

minimum codepoint

0

to

number

maximum codepoint

255

Returns:

font id

number

create_font_gdi

font_path

string

path to font or name of font

❌

size

number

font size

❌

flags

font flag

0

from

number

minimum codepoint

0

to

number

maximum codepoint

255

Returns:

font id

number

create_font_stream

bytes

table

table of bytes

❌

size

number

font size

❌

flags

font flag

0

from

number

minimum codepoint

0

to

number

maximum codepoint

255

Returns:

font id

number

get_text_size

font

number

font id from render.create_font

text

string

string to measure

Returns:

width

number

height

number

wrap_text

font

number

font id from render.create_font

text

string

string to measure

width

number

target text width

Returns:

text

string

text

font

number

font id

(see render.create_font)

❌

x

number

first x coord

❌

y

number

first y coord

❌

text

string

text to draw

❌

color

table

table of rgba values see render.color

❌

align_horizontal

number

horizontal alignment type

align_vertical

number

vertical alignment type

align_line

number

multiline alignment type

Pre-defined fonts:

  • font_gui_main

  • font_gui_title

  • font_gui_bold

  • font_esp

  • font_esp_name

  • font_indicator

Shaders

create_shader

src

string

shader source code

Supported pre-defined shader parameters:

Register

Type

s0

sampler

current texture

c0

float2

current texture's dimensions

c1

float

current time in seconds

c2

float

current global alpha override

Returns:

shader id

number

set_shader

shader_id

number / nil

shader id returned from render.create_shader

Usage:

Sets or resets a shader.

Textures

create_texture

texture_path

string

path to texture

Supported image formats:

  • JPEG

  • PNG

  • BMP

  • GIF (non-animated)

  • TGA

  • PSD

  • HDR

  • PIC

  • PNM (binary only)

Returns:

texture id

number

create_texture_bytes

bytes

unsigned char*

array of bytes

size

number

texture size

Supported Image Formats:

  • JPEG

  • PNG

  • BMP

  • GIF (non-animated)

  • TGA

  • PSD

  • HDR

  • PIC

  • PNM (binary only)

Returns:

texture id

number

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

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:

texture id

number

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

byte_stream

table of bytes

texture bytes

Returns:

texture id

number

create_texture_svg

image

string

svg data or svg file path

target_height

number

desired image height

Returns:

texture id

number

push_texture / set_texture

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

Usage:

Sets a texture used by render functions.

pop_texture

Usage:

Pops a previously used texture

push_uv / set_uv

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

Usage:

Pops a previously used set of texture coordinates.

get_texture_size

texture_id

number

texture id from create_texture

Returns:

width

number

height

number

get_frame_count

texture_id

number

texture id from create_texture

Returns:

framecount

number

Drawing

get_screen_size

Returns:

width

number

height

number

push_clip_rect

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.

pop_clip_rect

Usage:

Pops a previously used clip rect

rect_filled

x1

number

min x point

y1

number

min y point

x2

number

max x point

y2

number

max y point

color

table

table of rgba values see render.color

Usage:

Draws a filled rectangle. Use render.push_texture to apply a texture to the shape.

rect

x1

number

min x point

❌

y1

number

min y point

❌

x2

number

max x point

❌

y2

number

max y point

❌

color

table

table of rgba values see render.color

❌

thickness

float

thickness of line

1.f

outline

number

outline type

rect_rounded

x1

number

min x point

❌

y1

number

min y point

❌

x2

number

max x point

❌

y2

number

max y point

❌

color

table

table of rgba values see render.color

❌

rounding

number

amount of rounding

❌

rounding_flags

number

corners to round

thickness

float

thickness of line

1.f

outline

number

outline type

Usage:

Draws a filled rounded rectangle. Use render.push_texture to apply a texture to the shape.

rect_filled_rounded

x1

number

min x point

❌

y1

number

min y point

❌

x2

number

max x point

❌

y2

number

max y point

❌

color

table

table of rgba values see render.color

❌

rounding

number

amount of rounding

❌

rounding_flags

number

corners to round

Usage:

Draws a filled rounded rectangle. Use render.push_texture to apply a texture to the shape.

rect_filled_multicolor

x1

number

min x point

y1

number

min y point

x2

number

max x point

y2

number

max y point

top_left

table

table of rgba values see render.color

top_right

table

table of rgba values see render.color

bottom_right

table

table of rgba values see render.color

bottom_left

table

table of rgba values see render.color

Usage:

Draws a multi-color rectangle.

circle_filled

x

number

center x point

❌

y

number

center y point

❌

radius

number

the circles radius

❌

color

table

table of rgba values see render.color

❌

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

x

number

center x point

❌

y

number

center y point

❌

radius

number

the circles radius

❌

color

table

table of rgba values see render.color

❌

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

x1

number

first x coord

y1

number

first y coord

x2

number

second x coord

y2

number

second y coord

color

table

table of rgba values see render.color

line_multicolor

x1

number

first x coord

y1

number

first y coord

x2

number

second x coord

y2

number

second y coord

color

table

table of rgba values see render.color

color2

table

table of rgba values see render.color

triangle_filled

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

color

table

table of rgba values see render.color

Usage:

Draws a filled triangle. Use render.push_texture to apply a texture to the shape.

triangle

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

color

table

table of rgba values see render.color

triangle_filled_multicolor

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

color1

table

table of rgba values see render.color

color2

table

table of rgba values see render.color

color3

table

table of rgba values see render.color

Animations

create_animator_float

initial_value

starting value

❌

duration

number

how long to take in seconds

❌

easing_type

the animation type

Returns:

animator object

create_animator_color

initial_value

starting value

❌

duration

number

how long to take in seconds

❌

easing_type

the animation type

interpolate_hue

boolean

should the hue be animated

false

Returns:

animator object

Last updated