ποΈrender
Functions:
world_to_screen
render.world_to_screen(position: vector):
vector
Name | Type | Description |
---|---|---|
position |
| 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 |
| Font that will be initialized |
size |
| Size of the font |
flags |
|
|
Returns the FontObject
struct or nil on failure.
setup_weapon_font
render.setup_weapon_font(size: number):
FontObject
Name | Type | Description |
---|---|---|
size |
| Size of the font |
Returns the FontObject
struct or nil on failure.
setup_texture
render.setup_texture(path: string):
texture
Name | Type | Description |
---|---|---|
path |
| 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 |
| Font |
text |
| Text that will be measured |
Returns the size of the text.
Structs
π FontObject
FontObject
size
font.size:
number
Draw functions
blur
render.blur(x: number, y: number: width: number, height: number, alpha: number)
Name | Type | Description |
---|---|---|
x |
| X position |
y |
| Y position |
width |
| Width |
height |
| Height |
alpha |
| 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 |
| X position |
y |
| Y position |
x2 |
| X2 position |
y2 |
| Y2 position |
color |
| Color of the line |
thickness |
| Thickness of the line |
polygon
render.polygon(color: color, positions: {, ...})
color |
| Color of the polygon |
positions |
| Screen positions |
polyline
render.polyline(color: color, closed: boolean, thickness: number, positions: {, ...})
color |
| Color of the polyline |
closed |
| - |
thickness |
| Thickness of the polyline |
positions |
| Screen positions |
rect
render.rect(x: number, y: number, width: number, height: number, color: color[, rounding: number])
Name | Type | Description |
---|---|---|
x |
| X position |
y |
| Y position |
width |
| Width |
height |
| Height |
color |
| Color of the rectangle |
rounding |
| 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 |
| X position |
y |
| Y position |
width |
| Width |
height |
| Height |
color |
| Color of the rectangle |
rounding |
| 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 |
| X position |
y |
| Y position |
width |
| Width |
height |
| Height |
first_color |
| First color |
second_color |
| Second color |
type |
| Optional. |
circle
render.circle(x: number, y: number, points: number, radius: number, color: color)
Name | Type | Description |
---|---|---|
x |
| X position |
y |
| Y position |
points |
| Points of the circle |
radius |
| Radius of the circle |
color |
| Color of the circle |
circle_filled
render.circle_filled(x: number, y: number, points: number, radius: number, color: color)
Name | Type | Description |
---|---|---|
x |
| X position |
y |
| Y position |
points |
| Points of the circle |
radius |
| Radius of the circle |
color |
| Color of the circle |
glow_circle
render.glow_circle(x: number, y: number, radius: number, color: color)
Name | Type | Description |
---|---|---|
x |
| X position |
y |
| Y position |
radius |
| Radius of the circle |
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 |
| X position |
y |
| Y position |
radius |
| Radiusof the circle |
second_radius |
| Second radius of the circle |
min |
| Minimum value |
max |
| Maximum value |
color |
| Color of the circle |
circle_3d
render.circle_3d(position: vector, radius: number, color: color)
Name | Type | Description |
---|---|---|
position |
| Screen position |
radius |
| Radius of the circle |
color |
| Color of the circle |
circle_filled_3d
render.circle_filled_3d(position: vector, radius: number, color: color)
Name | Type | Description |
---|---|---|
position |
| Screen position |
radius |
| Radius of the circle |
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 |
| Font |
x |
| X position |
y |
| Y position |
color |
| Color of the text |
text |
| Text that will be drawn |
shadow |
| Optional. Text shadow |
outline |
| 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 |
| Font |
x |
| X position |
y |
| Y position |
color |
| Color of the text |
second_color |
| Second color of the text |
text |
| Text that will be drawn |
smooth |
| Smoothness of the gradient |
shadow |
| Optional. Text shadow |
outline |
| 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 |
x |
| X position |
y |
| Y position |
width |
| Width |
height |
| Height |
color |
| Color of the image |
rounding |
| 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 |
| X position |
y |
| Y position |
width |
| Width |
height |
| Height |
length |
| Shadow length |
color |
| Shadow color |
x_offset |
| Optional. X offset |
y_offset |
| 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 |
| Shadow position |
size |
| Shadow size |
rings |
| Shadow rings |
sbr |
|
|
length |
| Shadow length |
color |
| Shadow color |
x_offset |
| Optional. X offset |
y_offset |
| Optional. Y offset |
begin_cliprect
render.begin_cliprect(x: number, y: number, width: number, height: number)
Name | Type | Description |
---|---|---|
x |
| X position |
y |
| Y position |
width |
| Width |
height |
| 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