Drawing
Render lines, text, shapes and images on top of the game.
The Drawing library renders directly on top of the game window, above every Roblox interface. Drawings are cheap to create and cheap to update every frame, which makes them the right tool for overlays, HUDs and debug visualizations.
Creating drawings
Drawing.new
since 1.0.0Drawing.new(type: string): DrawingCreates a new drawing of the given type: "Line", "Text", "Square", "Circle", "Triangle", "Quad" or "Image". New drawings are invisible until you set Visible to true.
Parameters
typestring- The kind of drawing to create.
Returns
DrawingThe new drawing.
Example
Shared properties
Every drawing has these, whatever its type.
Visiblebooleanfalse.ZIndexnumber1.ColorColor3Transparencynumber0 (invisible) to 1 (opaque). Default 1.Call Remove() to destroy a drawing. Setting properties on a removed drawing errors. Destroy() is an alias.
Types
Line
FromVector2ToVector2Thicknessnumber1.Text
TextstringPositionVector2Center is true.SizenumberFontnumberDrawing.Fonts: UI (0), System (1), Plex (2) or Monospace (3).CenterbooleanPosition.OutlinebooleanOutlineColorColor3TextBoundsVector2Square
PositionVector2SizeVector2ThicknessnumberFilledbooleanCircle
PositionVector2RadiusnumberNumSidesnumberThicknessnumberFilledbooleanTriangle
PointA PointB PointCVector2ThicknessnumberFilledbooleanQuad
PointA PointB PointC PointDVector2ThicknessnumberFilledbooleanImage
Datastringreadfile or request.PositionVector2SizeVector2RoundingnumberUtilities
cleardrawcache
since 1.0.0cleardrawcache(): ()Removes every drawing, from every script. Handy at the top of a script you re-run often.
Example
isrenderobj
since 1.0.0isrenderobj(value: any): booleanReturns whether value is a Drawing object.
Parameters
valueany- The value to check.
Returns
booleantrue for drawings.
Example
getrenderproperty
since 1.0.0getrenderproperty(drawing: Drawing, property: string): anyReads a property of drawing by name. Equivalent to drawing[property].
Parameters
drawingDrawing- The drawing to read.
propertystring- The property name.
Returns
anyThe property's value.
Example
setrenderproperty
since 1.0.0setrenderproperty(drawing: Drawing, property: string, value: any): ()Writes a property of drawing by name. Equivalent to drawing[property] = value.
Parameters
drawingDrawing- The drawing to change.
propertystring- The property name.
valueany- The new value.
Example
Written for Lynx 0.0.0
Something unclear? Tell us on Discord