โ๏ธLayer
A layer is a type that is used to store render commands, as well as vertex and index data. This is the only way to push shapes and control rendering state.
g๏ปฟ
FieldRead only
Type: command
The next render command to be pushed to the queue. This is the object you want to change to, for example, set a texture, or change rendering modes.
font๏ปฟ
Field
Type: font_base
Font to use with add_text. If nothing has been set, no text will get rendered.
tex_sz๏ปฟ
Field
Type: vec2?
Texture dimensions. This value is only required if you are trying to render rounded shapes with a texture, so the rendering system will correctly map your UV coordinates to whatever shape you are rendering.
skip_dpi๏ปฟ
Field
Type: bool
If set to true, will skip global DPI scale. Defaults to true.
add_triangle_filled๏ปฟ
Method
Adds a filled triangle with a single color.
Arguments
Returns
Nothing.
Example
add_quad_filled๏ปฟ
Method
Adds a filled quad with a single color.
Arguments
Returns
Nothing.
Example
add_rect_filled๏ปฟ
Method
Adds a filled rectangle with a single color.
Arguments
Returns
Nothing.
Example
add_circle_filled๏ปฟ
Method
Adds a filled circle with a single color.
Arguments
Returns
Nothing.
Example
add_triangle_filled_multicolor๏ปฟ
Method
Adds a filled, multicolor triangle.
Arguments
Returns
Nothing.
Example
add_rect_filled_multicolor๏ปฟ
Method
Adds a filled, multicolor rectangle.
Arguments
Name
Type
Description
cols
table[color, color, color, color]
Colors for each corner of the rectangle, in clockwise order starting from top-left.
Returns
Nothing.
Example
add_circle_filled_multicolor๏ปฟ
Method
Adds a filled, multicolor circle.
Arguments
Name
Type
Description
radius
float
Circle radius.
cols
table[color, color]
Colors for the gradient, starting with the inner and ending with the outer color.
segments
int
The number of segments to approximate the circle. Defaults to 36.
fill
float
The portion of the circle to fill, where 1.0 is a full circle. Defaults to 1.0.
Returns
Nothing.
Example
add_quad_filled_multicolor๏ปฟ
Method
Adds a filled, multicolor quad.
Arguments
Returns
Nothing.
Example
add_pill_multicolor๏ปฟ
Method
Adds a multicolor pill shape.
Arguments
Name
Type
Description
radius_min
float
The minimum radius of the pill's rounded edges.
radius_max
float
The maximum radius of the pill's rounded edges.
cols
table[color, color]
Colors for the gradient, applied from bottom to top.
segments
int
The number of segments for approximating rounded edges. Defaults to 16.
Returns
Nothing.
Example
add_shadow_line๏ปฟ
Method
Adds a shadow line.
Arguments
Name
Type
Description
a
float
Max opacity. Defaults to 0.25.
Returns
Nothing.
Example
add_shadow_rect๏ปฟ
Method
Adds a shadowed rectangle.
Arguments
Name
Type
Description
radius
float
Shadow distance, in pixels, outwards.
bg
bool
Whether to draw a background for the rectangle. Defaults to true.
a
float
Max opacity of the shadow. Defaults to 0.25.
Returns
Nothing.
Example
add_glow๏ปฟ
Method
Adds a glow box.
Arguments
Name
Type
Description
radius
float
Glow distance, in pixels, outwards.
Returns
Nothing.
Example
add_rect_filled_rounded๏ปฟ
Method
Adds a filled, rounded rectangle.
Arguments
Returns
Nothing.
Example
add_rect_filled_rounded_multicolor๏ปฟ
Method
Adds a filled, multicolor rounded rectangle.
Arguments
Returns
Nothing.
Example
add_triangle๏ปฟ
Method
Adds a stroked triangle.
Arguments
Name
Type
Description
thickness
float
Line thickness. Defaults to 1.0.
Returns
Nothing.
Example
add_quad๏ปฟ
Method
Adds a stroked quad.
Arguments
Returns
Nothing.
Example
add_rect๏ปฟ
Method
Adds a stroked rectangle.
Arguments
Name
Type
Description
thickness
float
Line thickness. Defaults to 1.0.
Returns
Nothing.
Example
add_circle๏ปฟ
Method
Adds a stroked circle.
Arguments
Name
Type
Description
radius
float
Circle radius.
segments
int
Circle segments. Defaults to 36.
fill
float
Fill amount. Defaults to 1.0.
thickness
float
Line thickness. Defaults to 1.0.
Returns
Nothing.
Example
add_line๏ปฟ
Method
Adds a line.
Arguments
Returns
Nothing.
Example
add_line_multicolor๏ปฟ
Method
Adds a multicolor line.
Arguments
Returns
Nothing.
Example
add_rect_rounded๏ปฟ
Method
Adds a rounded, filled rectangle.
Arguments
Name
Type
Description
amount
float
Rounding amount.
thickness
float
Line thickness. Defaults to 1.0.
Returns
Nothing.
Example
add_text๏ปฟ
Method
Adds text.
If font wasn't set, this function will do nothing.
You can control the color while rendering the text. To change the color, add \fRRGGBBAA to the string. To reset the color, add \b.
Arguments
Name
Type
Description
text
string
Text.
Returns
Nothing.
Example
override_clip_rect๏ปฟ
Method
Overrides clip rectangle with support of intersection.
Arguments
Name
Type
Description
intersect
bool
Whether this function should intersect previous rect with the new one. Defaults to true.
Returns
Nothing.
Example
Last updated