โ๏ธ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: FontBase
Font to use with add_text. If nothing has been set, no text will get rendered.
texSz
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.
skipDpi
Field
Type: bool
If set to true, will skip global DPI scale. Defaults to true.
AddTriangleFilled
Method
Adds a filled triangle with a single color.
Arguments
Returns
Nothing.
Example
AddQuadFilled
Method
Adds a filled quad with a single color.
Arguments
Returns
Nothing.
Example
AddRectFilled
Method
Adds a filled rectangle with a single color.
Arguments
Returns
Nothing.
Example
AddCircleFilled
Method
Adds a filled circle with a single color.
Arguments
Returns
Nothing.
Example
AddTriangleFilledMulticolor
Method
Adds a filled, multicolor triangle.
Arguments
Returns
Nothing.
Example
AddRectFilledMulticolor
Method
Adds a filled, multicolor rectangle.
Arguments
Returns
Nothing.
Example
AddCircleFilledMulticolor
Method
Adds a filled, multicolor circle.
Arguments
Name
Type
Description
radius
float
Circle radius.
cols
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
AddQuadFilledMulticolor
Method
Adds a filled, multicolor quad.
Arguments
Returns
Nothing.
Example
AddPillMulticolor
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.
segments
int
The number of segments for approximating rounded edges. Defaults to 16.
Returns
Nothing.
Example
AddShadowLine
Method
Adds a shadow line.
Arguments
Returns
Nothing.
Example
AddShadowRect
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
AddGlow
Method
Adds a glow box.
Arguments
Returns
Nothing.
Example
AddRectFilledRounded
Method
Adds a filled, rounded rectangle.
Arguments
Returns
Nothing.
Example
AddRectFilledRoundedMulticolor
Method
Adds a filled, multicolor rounded rectangle.
Arguments
Returns
Nothing.
Example
AddTriangle
Method
Adds a stroked triangle.
Arguments
Name
Type
Description
thickness
float
Line thickness. Defaults to 1.0.
Returns
Nothing.
Example
AddQuad
Method
Adds a stroked quad.
Arguments
Returns
Nothing.
Example
AddRect
Method
Adds a stroked rectangle.
Arguments
Name
Type
Description
thickness
float
Line thickness. Defaults to 1.0.
Returns
Nothing.
Example
AddCircle
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
AddLine
Method
Adds a line.
Arguments
Returns
Nothing.
Example
AddLineMulticolor
Method
Adds a multicolor line.
Arguments
Returns
Nothing.
Example
AddRectRounded
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
AddText
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
OverrideClipRect
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
AddWithBlur
Method
Renders a section with blur applied to it.
Arguments
Name
Type
Description
callback
function
Render callback, applies the effect on all render calls inside it
Returns
Nothing.
Example
AddWithBlurShared
Method
Renders a section with blur applied to it. Uses a shared texture.
This method is preferred over AddWithBlur as it performs better.
Arguments
Name
Type
Description
callback
function
Render callback, applies the effect on all render calls inside it
Returns
Nothing.
Example
AddWithFrost
Method
Renders a section with a frosted effect to it, like in the Xmas theme.
Arguments
Name
Type
Description
callback
function
Render callback, applies the effect on all render calls inside it
Returns
Nothing.
Example
Last updated