Drawing class
The Drawing
class represents a renderable 2D object that appears on the user's screen. Every specific drawing type (e.g. Circle
, Text
, Line
) inherits from this base and extends it with shape-specific properties.
Drawing objects are not instances - they are client-only graphical primitives that do not interact with the 3D world and must be managed manually.
Constructor
Creates a new render object of the specified type. These objects render directly onto the game window and do not exist in the DataModel
.
Inheritance
The returned object inherits from the base Drawing
class, and will have specific properties based on its type.
Parameters
Parameter | Description |
---|---|
type |
The type of drawing to create. Must be one of: Line , Text , Image , Circle , Square , Quad , or Triangle . |
Shared properties
Note about the behaviour of the Transparency
property
Some implementations of the Drawing library by executors have mistakenly treated the Transparency
property as opacity rather than actual transparency. This confusion originates from the original UNC documentation, which incorrectly defined transparency as "the opacity of the drawing" (quite literally wrong, the opposite!).
In sUNC, we follow the correct meaning of the word. Transparency
represents true transparency, where 0
means fully opaque and 1
means fully transparent (see-through). This also aligns with how Roblox handles their transparency property on some instances (e.g. Part, Frame, etc).
All drawing object types inherit the following fields:
Property | Type | Description |
---|---|---|
Visible |
boolean |
Whether the object is rendered. Defaults to false . |
ZIndex |
number |
Render order; higher values appear on top. |
Transparency |
number |
Translucency, where 1 is fully transparent and 0 is fully visible. |
Color |
Color3 |
The color of the drawing. |
__OBJECT_EXISTS |
boolean |
Whether the drawing object exists. |
Methods
Method Signature | Description |
---|---|
Destroy() |
Permanently removes the drawing from view. |
Shape-specific types
Each subtype of Drawing
exposes unique fields that define their visual representation. Below are the supported types:
Line
Property | Type | Description |
---|---|---|
From |
Vector2 |
Start position of the line. |
To |
Vector2 |
End position of the line. |
Thickness |
number |
Width of the line. |
Text
Property | Type | Description |
---|---|---|
Text |
string |
The text content to render. |
TextBounds |
Vector2 🔒 |
Computed text size (read-only). |
Font |
Drawing.Font |
Font to use. |
Size |
number |
Size of the text. |
Position |
Vector2 |
Top-left corner of the text. |
Center |
boolean |
Horizontally center the text. |
Outline |
boolean |
Whether to draw an outline. |
OutlineColor |
Color3 |
Outline color. |
Image
Property | Type | Description |
---|---|---|
Data |
string |
Raw image byte string (e.g. from readfile ). |
Size |
Vector2 |
Size of the rendered image. |
Position |
Vector2 |
Top-left corner of the image. |
Rounding |
number |
Amount of corner rounding (optional aesthetic). |
Circle
Property | Type | Description |
---|---|---|
NumSides |
number |
Number of sides used to approximate the circle. |
Radius |
number |
Radius of the circle. |
Position |
Vector2 |
Center point of the circle. |
Thickness |
number |
Outline thickness (if not filled). |
Filled |
boolean |
Whether the circle is filled. |
Square
Property | Type | Description |
---|---|---|
Size |
Vector2 |
Size of the rectangle. |
Position |
Vector2 |
Top-left corner. |
Thickness |
number |
Outline thickness (if not filled). |
Filled |
boolean |
Whether the square is filled. |
Quad
Property | Type | Description |
---|---|---|
PointA |
Vector2 |
First point. |
PointB |
Vector2 |
Second point. |
PointC |
Vector2 |
Third point. |
PointD |
Vector2 |
Fourth point. |
Thickness |
number |
Outline thickness (if not filled). |
Filled |
boolean |
Whether the quad is filled. |
Triangle
Property | Type | Description |
---|---|---|
PointA |
Vector2 |
First point. |
PointB |
Vector2 |
Second point. |
PointC |
Vector2 |
Third point. |
Thickness |
number |
Outline thickness (if not filled). |
Filled |
boolean |
Whether the triangle is filled. |