đ¨render
Last updated
Last updated
render.screen_size():
vector
render.camera_position():
vector
Returns the camera position vector.
render.camera_angles([angles: vector]):
vector
Name | Type | Description |
---|---|---|
Returns or sets the camera angles.
render.world_to_screen(position: vector):
vector
Name | Type | Description |
---|---|---|
đ Note that there is a cleaner alternative, the :to_screen
vector function.
Returns the screen position vector, or nil if the world position is not visible on your screen. This can only be called from the render callback.
render.get_offscreen(position: vector, radius: number[, accurate: boolean]):
vector
, number
, boolean
Returns the position
, rotation
, and is_out_of_fov
arguments or nil on failure.
position
: Screen coordinates (Returns ellipse-based position if the world position is out of FOV)
rotation
: Yaw axis that can be used to rotate drawing stuff
is_out_of_fov
: Returns true
if the world position is out of FOV.
render.get_pixel(position: vector)
Getting the color of the pixel is a heavy process. Do not do it inside callbacks that are called a lot of times per second.
Returns the color of the specified pixel on the screen.
đ Render any text via the draw:text
function.
render.load_font(name: string, size: number[, flags: string]):
FontObject
Returns the FontObject
struct or nil on failure.
đ Render any image via the :texture
function.
render.load_image(contents: string, size: vector):
ImgObject
Returns the ImgObject
struct or nil on failure. Supports JPG, PNG, BMP, SVG, and GIF formats.
đ Render any image via the :texture
function.
render.load_image_rgba(contents: string, size: vector):
ImgObject
Returns the ImgObject
struct or nil on failure.
đ Render any image via the :texture
function.
render.load_image_from_file(path: string, size: vector):
ImgObject
âšī¸ Loading images from game resources is supported.
Example:
render.load_image_from_file 'materials/panorama/images/icons/ui/warning.svg'
Returns the ImgObject
struct or nil on failure. Supports JPG, PNG, BMP, SVG, and GIF formats.
render.measure_text(font: FontObject[, flags: string], text: string):
vector
Returns the measured size of the text.
render.highlight_hitbox(entity: entity, hitbox: number, color: color)
Highlights the specified hitbox / hitboxes.
render.get_scale(type: number):
number
Returns the DPI scale value.
ImgObject
img.width
:
number
img.height
:
number
img.resolution
:
number
FontObject
font.width
:
number
font.height
:
number
font.spacing
:
number
font:set_size(size: number)
Sets the new font size.
render.blur(position_a: vector, position_b: vector, strength: number, alpha: number[, rounding: number])
render.line(position_a: vector, position_b: vector, color: color)
render.poly(color: color, positions: vector[, ...])
render.poly_blur(opacity: number, strength: number, positions: vector[, ...])
render.poly_line(color: color, positions: vector[, ...])
render.rect(position_a: vector, position_b: vector, color: color[, rounding: number, no_clamp: boolean])
render.rect_outline(position_a: vector, position_b: vector, color: color[, thickness: number, rounding: number, no_clamp: boolean])
render.gradient(position_a: vector, position_b: vector, top_left: color, top_right: color, bottom_left: color, bottom_right: color[, rounding: number])
render.circle(position: vector, color: color, radius: number, start_deg: number, pct: number)
render.circle_outline(position: vector, color: color, radius: number, start_deg: number, pct: number[, thickness: number])
render.circle_gradient(position: vector, color_outer: color, color_inner: color, radius: number, start_deg: number, pct: number)
render.circle_3d(position: vector, color: color, radius: number, start_deg: number, pct: number[, outline: boolean])
render.circle_3d_outline(position: vector, color: color, radius: number, start_deg: number, pct: number[, thickness: number])
render.circle_3d_gradient(position: vector, color_outer: color, color_inner: color, radius: number, start_deg: number, pct: number)
đ Render any text via the :load_font
function.
render.text(font: FontObject, position: vector, color: color, flags: string, text:any[, ...])
Draws the specified text.
đ Create the texture via the :load_image
function.
render.texture(texture: ImgObject, position: vector[, size: vector, color: color, mode: string, rounding: number])
render.push_rotation(degrees: number)
Applies the rotation for all subsequent elements.
render.pop_rotation()
Discards an early set rotation.
render.push_clip_rect(pos_a: vector, pos_b: vector[, intersect: boolean])
Applies the clip region to the given rectangle for all subsequent elements.
render.pop_clip_rect()
Discards an early set rectangle clipping region.
render.shadow(pos_a: vector, pos_b: vector, clr: color[, thickness: number, offset: number, rounding: number])
Draws a shadow rectangle.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|