🎨Render
Table to work with render v2.
FilledRect(start: Vec2
, end_: Vec2
, color: Color
, rounding [?]
: number
, flags [?]
: Enum.DrawFlags
): nil
Vec2
, end_: Vec2
, color: Color
, rounding [?]
: number
, flags [?]
: Enum.DrawFlags
): nil
start
The starting point of the rectangle.
end_
The ending point of the rectangle.
color
The color of the rectangle.
rounding [?]
number
The rounding radius of the rectangle corners. (default: 0.0)
flags [?]
Custom flags for drawing. (default: Enum.DrawFlags.None)
Draws a filled rectangle.
Rect(start: Vec2
, end_: Vec2
, color: Color
, rounding [?]
: number
, flags [?]
: Enum.DrawFlags
, thickness [?]
: number
): nil
Vec2
, end_: Vec2
, color: Color
, rounding [?]
: number
, flags [?]
: Enum.DrawFlags
, thickness [?]
: number
): nil
start
The starting point of the rectangle.
end_
The ending point of the rectangle.
color
The color of the rectangle's border.
rounding [?]
number
The rounding radius of the rectangle corners. (default: 0.0)
flags [?]
Custom flags for drawing. (default: Enum.DrawFlags.None)
thickness [?]
number
The thickness of the rectangle's border. (default: 1.0)
Draws an unfilled rectangle.
start
The starting point of the rectangle.
end_
The ending point of the rectangle.
color
The color of the rectangle.
percent
number
The percentage of the rectangle to fill [0..1].
rounding
number
The rounding radius of the rectangle corners.
thickness [?]
number
The thickness of the rectangle's border. (default: 1.0)
Draw a progress rectangle.
start
The starting point of the line.
end_
The ending point of the line.
color
The color of the line.
thickness [?]
number
The thickness of the line. (default: 1.0)
Draws a line between two points.
points
A table of Vec2 points to connect with lines.
color
The color of the polyline.
thickness [?]
number
The thickness of the polyline. (default: 1.0)
Draws a series of connected lines (polyline).
pos
The center position of the circle.
radius
number
The radius of the circle.
color
The color of the circle.
thickness [?]
number
The thickness of the circle's outline. (default: 1.0)
startDeg [?]
number
The starting degree for drawing the circle. 0 is right side, 90 is bottom, 180 is left, 270 is top. (default: 0.0)
percentage [?]
number
The percentage of the circle to draw, in the range [0.0-1.0]. (default: 1.0)
rounded [?]
boolean
Whether the circle is rounded. (default: false)
segments [?]
integer
The number of segments used for drawing the circle. (default: 32)
Draws a circle.
pos
The center position of the circle.
radius
number
The radius of the circle.
color
The color of the circle.
startDeg [?]
number
The starting degree for drawing the circle. 0 is right side, 90 is bottom, 180 is left, 270 is top. (default: 0.0)
percentage [?]
number
The percentage of the circle to draw, in the range [0.0-1.0]. (default: 1.0)
segments [?]
integer
The number of segments used for drawing the circle. (default: 32)
Draws a filled circle.
pos
The center position of the circle.
radius
number
The radius of the circle.
colorOuter
The outer color of the gradient.
colorInner
The inner color of the gradient.
startDeg [?]
number
The starting degree for drawing the circle. 0 is right side, 90 is bottom, 180 is left, 270 is top. (default: 0.0)
percentage [?]
number
The percentage of the circle to draw, in the range [0.0-1.0]. (default: 1.0)
Draws a circle with a gradient.
points
A table of three Vec2 points defining the vertices of the triangle.
color
The color of the triangle's outline.
thickness [?]
number
The thickness of the triangle's outline. (default: 1.0)
Draws a triangle outline.
points
A table of three Vec2 points defining the vertices of the triangle.
color
The color of the triangle.
Draws a filled triangle.
points
A table of Vertex points defining the vertices of the polygon. Each Vertex contains a position (Vec2) and a texture coordinate (Vec2).
textureHandle
integer
The handle to the texture to be applied to the polygon.
color
The color to apply over the texture. This can be used to tint the texture.
grayscale [?]
number
The grayscale of the image. (default: 0.0)
Draws a textured polygon.
fontName
string
The name of the font to load.
fontFlag [?]
Flags for font creation, such as antialiasing. (default: Enum.FontCreate.FONTFLAG_NONE)
weight [?]
integer
The weight (thickness) of the font. Typically, 0 means default weight. (default: 400)
Loads a font and returns its handle. Returns handle to the loaded font.
font
integer
The handle to the font used for drawing the text.
fontSize
number
The size of the font.
text
string
The text to be drawn.
pos
The position where the text will be drawn.
color
The color of the text.
Draws text at a specified position.
pos
The 3D world position to be converted.
Converts a 3D world position to a 2D screen position. Returns A Vec2 representing the 2D screen position and a boolean indicating visibility on the screen.
Example
ScreenSize(): Vec2
Vec2
Retrieves the current screen size, returning it as a Vec2 where x is the width and y is the height of the screen.
font
integer
The handle to the font used for measuring the text.
fontSize
number
The size of the font.
text
string
The text to measure.
Calculates the size of the given text using the specified font, returning the size as a Vec2 where x is the width and y is the height of the text.
LoadImage(path: string
): integer
string
): integer
path
string
Path to the image.
Loads an image and returns its handle.
imageHandle
integer
The handle to the image.
pos
The position to draw the image.
size
The size of the image.
color
The color to tint the image.
rounding [?]
number
The rounding radius of the image corners. (default: 0.0)
flags [?]
Custom flags for drawing. (default: Enum.DrawFlags.None)
uvMin [?]
The minimum UV coordinates for texture mapping. (default: {0.0, 0.0})
uvMax [?]
The maximum UV coordinates for texture mapping. (default: {1.0, 1.0})
grayscale [?]
number
The grayscale of the image. (default: 0.0)
Draws an image at a specified position and size.
imageHandle
integer
The handle to the image.
pos
The center position to draw the image.
size
The size of the image.
color
The color to tint the image.
rounding [?]
number
The rounding radius of the image corners. (default: 0.0)
flags [?]
Custom flags for drawing. (default: Enum.DrawFlags.None)
uvMin [?]
The minimum UV coordinates for texture mapping. (default: {0.0, 0.0})
uvMax [?]
The maximum UV coordinates for texture mapping. (default: {1.0, 1.0})
grayscale [?]
number
The grayscale of the image. (default: 0.0)
Draws an image centered at a specified position and size.
ImageSize(imageHandle: integer
): Vec2
integer
): Vec2
imageHandle
integer
The handle to the image.
Retrieves the size of an image. Returns the size of the image as a Vec2.
start
The starting point of the gradient rectangle.
end_
The ending point of the gradient rectangle.
topLeft
The color of the top-left corner.
topRight
The color of the top-right corner.
bottomLeft
The color of the bottom-left corner.
bottomRight
The color of the bottom-right corner.
rounding [?]
number
The rounding radius of the rectangle corners. (default: 0.0)
flags [?]
Custom flags for drawing. (default: Enum.DrawFlags.None)
thickness [?]
number
The thickness of the outline. (default: 1.0)
Draws a outlined gradient rectangle.
start
The starting point of the gradient rectangle.
end_
The ending point of the gradient rectangle.
topLeft
The color of the top-left corner.
topRight
The color of the top-right corner.
bottomLeft
The color of the bottom-left corner.
bottomRight
The color of the bottom-right corner.
rounding [?]
number
The rounding radius of the rectangle corners. (default: 0.0)
flags [?]
Custom flags for drawing. (default: Enum.DrawFlags.None)
Draws a filled gradient rectangle.
Shadow(start: Vec2
, end_: Vec2
, color: Color
, thickness: number
, obj_rounding [?]
: number
, flags [?]
: Enum.DrawFlags
, offset [?]
: Vec2
): nil
Vec2
, end_: Vec2
, color: Color
, thickness: number
, obj_rounding [?]
: number
, flags [?]
: Enum.DrawFlags
, offset [?]
: Vec2
): nil
start
The starting point of the shadow rectangle.
end_
The ending point of the shadow rectangle.
color
The color of the shadow.
thickness
number
The thickness of the shadow.
obj_rounding [?]
number
The rounding radius of the shadow rectangle corners. (default: 0.0)
flags [?]
Custom flags for drawing the shadow. (default: Enum.DrawFlags.ShadowCutOutShapeBackground)
offset [?]
The offset of the shadow from the original rectangle. (default: {0.0, 0.0})
Draws a shadow effect within a specified rectangular area.
ShadowCircle(center: Vec2
, radius: number
, color: Color
, thickness: number
, num_segments [?]
: integer
, flags [?]
: Enum.DrawFlags
, offset [?]
: Vec2
): nil
Vec2
, radius: number
, color: Color
, thickness: number
, num_segments [?]
: integer
, flags [?]
: Enum.DrawFlags
, offset [?]
: Vec2
): nil
center
The center point of the circle.
radius
number
The radius of the circle.
color
The color of the shadow.
thickness
number
The thickness of the shadow.
num_segments [?]
integer
The number of segments for drawing the circle. (default: 12)
flags [?]
Custom flags for drawing the shadow. (default: Enum.DrawFlags.ShadowCutOutShapeBackground)
offset [?]
The offset of the shadow from the circle. (default: {0.0, 0.0})
Draws a circle shadow effect.
ShadowConvexPoly(points: Vec[]
, color: Color
, thickness: number
, flags [?]
: Enum.DrawFlags
, offset [?]
: Vec2
): nil
Vec[]
, color: Color
, thickness: number
, flags [?]
: Enum.DrawFlags
, offset [?]
: Vec2
): nil
points
Vec[]
Table of Vec2 points defining the convex polygon. Should be more than 2 points.
color
The color of the shadow.
thickness
number
The thickness of the shadow.
flags [?]
Custom flags for drawing the shadow. (default: Enum.DrawFlags.ShadowCutOutShapeBackground)
offset [?]
The offset of the shadow from the polygon. (default: {0.0, 0.0})
Draws a shadow convex polygon effect.
ShadowNGon(center: Vec2
, radius: number
, color: Color
, thickness: number
, num_segments: integer
, flags [?]
: Enum.DrawFlags
, offset [?]
: Vec2
): nil
Vec2
, radius: number
, color: Color
, thickness: number
, num_segments: integer
, flags [?]
: Enum.DrawFlags
, offset [?]
: Vec2
): nil
center
The center point of the n-gon.
radius
number
The radius of the n-gon.
color
The color of the shadow.
thickness
number
The thickness of the shadow.
num_segments
integer
The number of segments (sides) of the n-gon.
flags [?]
Custom flags for drawing the shadow. (default: Enum.DrawFlags.ShadowCutOutShapeBackground)
offset [?]
The offset of the shadow from the n-gon. (default: {0.0, 0.0})
Draws a shadow n-gon (polygon with n sides) effect.
Blur(start: Vec2
, end_: Vec2
, strength [?]
: number
, alpha [?]
: number
, rounding [?]
: number
, flags [?]
: Enum.DrawFlags
): nil
Vec2
, end_: Vec2
, strength [?]
: number
, alpha [?]
: number
, rounding [?]
: number
, flags [?]
: Enum.DrawFlags
): nil
start
The starting point of the blur rectangle.
end_
The ending point of the blur rectangle.
strength [?]
number
The strength of the blur effect. (default: 1.0)
alpha [?]
number
The alpha value of the blur effect. (default: 1.0)
rounding [?]
number
The rounding radius of the blur rectangle corners. (default: 0.0)
flags [?]
Custom flags for the blur effect. (default: Enum.DrawFlags.None)
Applies a blur effect within a specified rectangular area.
start
The starting point of the clipping rectangle.
end_
The ending point of the clipping rectangle.
intersect [?]
boolean
If true, the new clipping area is intersected with the current clipping area. (default: false)
Begins a new clipping region. Only the rendering within the specified rectangular area will be displayed.
PopClip(): nil
nil
Ends the most recently begun clipping region, restoring the previous clipping region.
StartRotation(angle: number
): nil
number
): nil
angle
number
The rotation angle.
Begins a new rotation.
StopRotation(): nil
nil
End the rotation.
SetGlobalAlpha(alpha: number
): nil
number
): nil
Do not forget to reset the global alpha value after your rendering.
alpha
number
The alpha value to set [0..1]
Set the global alpha value for rendering.
ResetGlobalAlpha(): nil
nil
Reset the global alpha value for rendering to 1.0.
Last updated