Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

algorithm in drawing with textlabel?

Asked by
pwx 1581 Moderation Voter
6 years ago

I'll try as be as brief as possible so I don't bore you to death with all this reading.

I am currently trying to create an algorithm that detects letters, numbers and shapes that I am drawing within' the UI.

An example:

If I were to type the letter 'L' like so - https://gyazo.com/c6b824523175ae62c6caee191a4f4764.gif

In the output, it would print the letter 'L', obviously.

Shape type of situation if I were to draw a circle, it would print in the output 'Circle.'

The code I currently have is this:

01local mouse = game.Players.LocalPlayer:GetMouse()
02local frame = script.Parent.ScreenGui.Frame
03 
04local holding = false
05 
06spawn(function()
07    while wait() do
08        if holding then
09            if not frame:FindFirstChild(mouse.X..'/'..mouse.Y) then
10                local txt = script.TextLabel:Clone()
11                txt.Parent = frame
12                txt.Name = mouse.X..'/'..mouse.Y
13                txt.Position = UDim2.new(0, mouse.X - 3, 0, mouse.Y - 3)
14            end
15        end
View all 29 lines...

As you can see, I use a TextLabel with the Zindex of 1 to create a 'drawing mark' if you will.

If any of you could help me out I'd be totally grateful, thanks in advanced.

0
Bump pwx 1581 — 6y

Answer this question