sunc docs
  • sUNC Introduction
  • Closures
    • hookfunction
    • hookmetamethod
    • newcclosure
    • iscclosure
    • islclosure
    • isexecutorclosure
    • clonefunction
    • getfunctionhash
  • Cryptography
    • crypt.base64encode
    • crypt.base64decode
  • Debug
    • debug.getconstants
    • debug.getconstant
    • debug.setconstant
    • debug.getupvalues
    • debug.getupvalue
    • debug.setupvalue
  • debug.getstack
  • debug.setstack
  • debug.getprotos
  • debug.getproto
  • Drawing
    • Drawing.new
      • Drawing Objects
    • cleardrawcache
    • getrenderproperty
    • setrenderproperty
    • isrenderobj
  • Environment
    • getgenv
    • getrenv
    • getgc
    • filtergc
  • Filesystem
    • appendfile
    • writefile
    • readfile
    • listfiles
    • isfile
    • delfile
    • loadfile
    • makefolder
    • isfolder
    • delfolder
    • getcustomasset
  • Instances
    • fireproximityprompt
    • fireclickdetector
    • firetouchinterest
    • getinstances
    • getnilinstances
    • cloneref
    • gethui
    • getcallbackvalue
    • compareinstances
  • Metatables
    • getrawmetatable
    • setrawmetatable
    • setreadonly
    • isreadonly
  • Miscellaneous
    • identifyexecutor
    • request
  • Reflection
    • gethiddenproperty
    • sethiddenproperty
    • setscriptable
    • checkcaller
    • setthreadidentity
    • getthreadidentity
  • Scripts
    • getscriptbytecode
    • getscripthash
    • getscriptclosure
    • getsenv
    • getscripts
    • getrunningscripts
    • getloadedmodules
    • getcallingscript
    • loadstring
  • Signals
    • getconnections
      • The Connection object
    • firesignal
    • replicatesignal
  • Websocket
    • WebSocket.connect
Powered by GitBook
On this page
  • Line
  • Text
  • Image
  • Circle
  • Square
  • Triangle
  • Example image
  • Example __OBJECT_EXISTS
  1. Drawing
  2. Drawing.new

Drawing Objects

The class which all drawing objects will inherit.

Property
Type
Description

Visible

boolean

Whether the drawing is visible. Defaults to false.

ZIndex

number

Determines the order in which a Drawing renders relative to others.

Transparency

number

The opacity of the drawing (1 - opaque, 0 - transparent).

Color

Color3

The color of the drawing.

__OBJECT_EXISTS

boolean

Whether the object exists.

Destroy(): ()

function

Destroys the drawing.


Line

Renders a line starting at From and ending at To.

Property
Type
Description

From

Vector2

The starting point of the line.

To

Vector2

The ending point of the line.

Thickness

number

The thickness of the line.


Text

Renders text at Position.

Property
Type
Description

Text

string

The text to render.

TextBounds

🔒 Vector2

The size of the text. Cannot be set.

Font

Drawing.Font

The font to use.

Size

number

The size of the text.

Position

Vector2

The position of the text.

Center

boolean

Whether the text should be centered horizontally.

Outline

boolean

Whether the text should be outlined.

OutlineColor

Color3

The color of the outline.


Image

Draws the image data to the screen. Data must be the raw image data.

Property
Type
Description

Data

string

The raw image data of the file. You can use readfile or another method to read the raw bytecode of the image.

Size

Vector2

The size of the image.

Position

Vector2

The position of the image.

Rounding

number

The rounding of the image.


Circle

Draws a circle that is centered at Position.

Property
Type
Description

NumSides

number

The sides number of the circle.

Radius

number

The radius of the circle.

Position

Vector2

The center position of the circle.

Thickness

number

If Filled is false, specifies the thickness of the outline.

Filled

boolean

Whether the circle should be filled.


Square

Draws a rectangle starting at Position and ending at Position + Size.

Property
Type
Description

Size

Vector2

The size of the square.

Position

Vector2

The top-left corner position of the square.

Thickness

number

If Filled is false, specifies the thickness of the outline.

Filled

boolean

Whether the square should be filled.

Quad

Draws a four-sided figure connecting to each of the four points.

Property
Type
Description

PointA

Vector2

The first point.

PointB

Vector2

The second point.

PointC

Vector2

The third point.

PointD

Vector2

The fourth point.

Thickness

number

If Filled is false, specifies the thickness of the outline.

Filled

boolean

Whether the quad should be filled.


Triangle

Draws a triangle connecting to each of the three points.

Property
Type
Description

PointA

Vector2

The first point.

PointB

Vector2

The second point.

PointC

Vector2

The third point.

Thickness

number

If Filled is false, specifies the thickness of the outline.

Filled

boolean

Whether the triangle should be filled.


Example image

local Camera = game.Workspace.CurrentCamera
local Viewport = Camera.ViewportSize
local Position = Vector2.new(Viewport.X / 2, Viewport.Y / 2)
local image = Drawing.new("Image")
image.Data = readfile("your_image.png")
image.Size = Vector2.new(455, 155)
image.Visible = true
image.Position = Position

task.wait(2)
image:Destroy()

Example __OBJECT_EXISTS

local Camera = game.Workspace.CurrentCamera
local Viewport = Camera.ViewportSize
local Position = Vector2.new(Viewport.X / 2, Viewport.Y / 2)

local circle = Drawing.new("Circle")
circle.Radius = 50
circle.Color = Color3.fromRGB(255, 0, 0)
circle.Filled = true
circle.NumSides = 150
circle.Position = Position
circle.Transparency = 1
circle.Visible = true

print(circle.__OBJECT_EXISTS) -- Output: true
circle:Destroy()
print(circle.__OBJECT_EXISTS) -- Output: false
PreviousDrawing.newNextcleardrawcache

Last updated 2 months ago