DrawingImmediate
The DrawingImmediate Library provides support for instantaneous drawing (unlike Drawing.new which requires manual management of objects, including deletion)
Notes; Erroring within the DrawingImmediate context will cause a stack-less error (Stack Begin, Stack End) Yielding is currently not supported within the DrawingImmediate context
clearimmediatecache
Clears every connected drawingimmediate connectionDrawingImmediate.Clear()
alias of clearimmediatecache, Clears every connected drawingimmediate connectionDrawingImmediate.GetPaint()
Returns a signal that will draw with theZIndex
specified, if no ZIndex is specified (none), then the
default ZIndex will be 1
Draws a white circle with 60 radius where your cursor is
local UserInputService = game.UserInputService
DrawingImmediate.GetPaint():Connect(function(Context)
Context.Circle(UserInputService:GetMouseLocation(), 60, Color3.new(1, 1, 1), 1, 60, 1)
end)
DrawingImmediate.New()
alias of GetPaintDrawing Context Functions
When connecting the signal as shown in the GetPaint example, The first argument will be a draw context (specific to that zindex)
Example to show how you can use drawing immediate contexts
Functions are as follows:
Context.Circle()
function Circle(center: Vector2, radius: number, color: Color3, opacity: number, num_sides: int, thickness: number)
Context.FilledCircle()
function FilledCircle(center: Vector2, radius: number, color: Color3, num_sides: int, opacity: number)
Context.Line()
Draws a line within the current DrawingImmediate ContextContext.Triangle()
function Triangle(p1: Vector2, p2: Vector2, p3: Vector3, color: Color3, opacity: number, thickness: number)
Context.FilledTriangle()
Draws a filled triangle within the current DrawingImmediate ContextContext.Rectangle()
function Rectangle(pos: Vector2, size: Vector2, color: Color3, opacity: number, rounding: number, thickness: number)
Context.FilledRectangle()
function FilledRectangle(pos: Vector2, size: Vector2, color: Color3, opacity: number, rounding: number)
Context.Quad()
function Quad(p1: Vector2, p2: Vector2, p3: Vector2, p4: Vector2, color: Color3, opacity: number, thickness: number)
Context.FilledQuad()
function FilledQuad(p1: Vector2, p2: Vector2, p3: Vector2, p4: Vector2, color: Color3, opacity: number, thickness: number)
Context.Text()
function Text(position: Vector2, font: DrawFont, font_size: number, color: Color3, opacity: number, text: string, center: bool)