Drawing Library

Drawing New

<object> Drawing.new(<string> type)

Creates a new drawing object with type. Returns the object.

Fonts

The following fonts are available within the Drawing.Fonts table.

FontNumber
UI0
System1
Plex2
Monospace3

Base Properties

bool Visible;
number Transparency;
Color3 Color;
void Remove();

Notes:

  • All other classes derive from this base class.
  • Transparency is the opposite than on normal GUI elements - 1 means fully opaque, while 0 means fully transparent.

Types:


Line

number Thickness;
Vector2 From;
Vector2 To;

Text

string Text;
number Size;
bool Center;
bool Outline;
Color3 OutlineColor;
Vector2 Position;
readonly<Vector2> TextBounds;
Drawing.Font Font;

Image

writeonly<string> Data;
Vector2 Size;
Vector2 Position;
number Rounding;

Notes:

  • Data does NOT refer to the URL of the image. You must grab the image data yourself (game:HttpGet), then assign that to Data.

Circle

number Thickness;
number NumSides;
number Radius;
bool Filled;
Vector2 Position;

Square

number Thickness;
Vector2 Size;
Vector2 Position;
bool Filled;

Quad

number Thickness;
Vector2 PointA;
Vector2 PointB;
Vector2 PointC;
Vector2 PointD;
bool Filled;

Notes:

  • The points are in counter-clockwise order - PointA is top-right, PointB is top-left, PointC is bottom-left, PointD is bottom-right.

Triangle

number Thickness;
Vector2 PointA;
Vector2 PointB;
Vector2 PointC;
bool Filled;

Example

local Line = Drawing.new("Line")
Line.Visible = true
Line.From = Vector2.new(0, 0)
Line.To = Vector2.new(200, 200)
Line.Color = Color3.fromRGB(255, 255, 255)
Line.Thickness = 2
Line.Transparency = 1

wait(5)

Line:Remove() --Drawing objects are manually managed.