local m=game:GetService("\071\117\105\083\101\114\118\105\099\101")local n=game:GetService("\080\108\097\121\101\114\115")local K=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local k=game:GetService("\085\115\101\114\073\110\112\117\116\083\101\114\118\105\099\101")local i=require(K.Geo)local w=Instance.new("\083\099\114\101\101\110\071\117\105")w.Name="\068\114\097\119\105\110\103"local C=Instance.new("\070\114\097\109\101")C.Name="\067\111\110\116\097\105\110\101\114"C.Size=UDim2.fromOffset(400,400)C.BackgroundColor3=Color3.fromRGB(255,255,255)C.Parent=w local Q=Instance.new("\084\101\120\116\076\097\098\101\108")Q.Name="\073\110\102\111"Q.Text="\067\108\105\099\107 \116\111 \100\114\097\119"Q.TextSize=24 Q.TextColor3=Color3.fromRGB(0,0,0)Q.BackgroundTransparency=1 Q.Size=UDim2.fromScale(1,1)Q.Parent=C local W=Instance.new("\070\114\097\109\101")W.Name="\067\097\110\118\097\115"W.Size=UDim2.fromScale(1,1)W.BackgroundTransparency=1 W.Parent=C local u do u=Instance.new("\070\114\097\109\101")u.Name="\080\111\105\110\116"u.Size=UDim2.fromOffset(2,2)u.BorderSizePixel=0 u.BackgroundColor3=Color3.fromRGB(0,0,0)end local o={}local function P()Q.Text=""W:ClearAllChildren()o={}end local function b()local n=k:GetMouseLocation()local K=m:GetGuiInset()local i=Vector2.new(n.X,n.Y-K.Y)local w=u:Clone()w.Position=UDim2.fromOffset(i.X,i.Y)w.Parent=W table.insert(o,i)end local function a(m,n)local K K=m.Changed:Connect(function()if m.UserInputState==Enum.UserInputState.End then K:Disconnect()n()end end)end W.InputBegan:Connect(function(m)if m.UserInputType==Enum.UserInputType.MouseButton1 then P()b()local n=W.MouseMoved:Connect(b)a(m,function()n:Disconnect()local m=i.detectShape(o)or"\078\111\110\101"local K=i.detectOrientation(o)or"\078\111\110\101"Q.Text=("\083\104\097\112\101\058 \037\115\n\079\114\105\101\110\116\097\116\105\111\110\058 \037\115"):format(m,K)end)end end)w.Parent=n.LocalPlayer.PlayerGui
--[[
    This example allows you to draw points on a canvas. After you stop drawing,
    those points are run through Geo to detect what kind of shape was drawn.
]]

local GuiService = game:GetService("GuiService")
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local UserInputService = game:GetService("UserInputService")

local Geo = require(ReplicatedStorage.Geo)

local screen = Instance.new("ScreenGui")
screen.Name = "Drawing"

local container = Instance.new("Frame")
container.Name = "Container"
container.Size = UDim2.fromOffset(400, 400)
container.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
container.Parent = screen

local info = Instance.new("TextLabel")
info.Name = "Info"
info.Text = "Click to draw"
info.TextSize = 24
info.TextColor3 = Color3.fromRGB(0, 0, 0)
info.BackgroundTransparency = 1
info.Size = UDim2.fromScale(1, 1)
info.Parent = container

local canvas = Instance.new("Frame")
canvas.Name = "Canvas"
canvas.Size = UDim2.fromScale(1, 1)
canvas.BackgroundTransparency = 1
canvas.Parent = container

local POINT_FRAME do
    POINT_FRAME = Instance.new("Frame")
    POINT_FRAME.Name = "Point"
    POINT_FRAME.Size = UDim2.fromOffset(2, 2)
    POINT_FRAME.BorderSizePixel = 0
    POINT_FRAME.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
end

local points = {}

local function clear()
    info.Text = ""
    canvas:ClearAllChildren()
    points = {}
end

local function addPoint()
    local mouse = UserInputService:GetMouseLocation()
    local inset = GuiService:GetGuiInset()
    local point = Vector2.new(mouse.X, mouse.Y - inset.Y)

    local newPoint = POINT_FRAME:Clone()
    newPoint.Position = UDim2.fromOffset(point.X, point.Y)
    newPoint.Parent = canvas

    table.insert(points, point)
end

local function onInputEnd(input, callback)
    local event
    event = input.Changed:Connect(function()
        if input.UserInputState == Enum.UserInputState.End then
            event:Disconnect()
            callback()
        end
    end)
end

canvas.InputBegan:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1 then
        clear()
        addPoint()

        local mouseMove = canvas.MouseMoved:Connect(addPoint)

        onInputEnd(input, function()
            mouseMove:Disconnect()

            local shape = Geo.detectShape(points) or "None"
            local orientation = Geo.detectOrientation(points) or "None"

            info.Text = ("Shape: %s\nOrientation: %s"):format(shape, orientation)
        end)
    end
end)

screen.Parent = Players.LocalPlayer.PlayerGui
