I wrote a simple Shift-lock function in Lua for you. Please note: it's very basic, so you must turn the lock off when you want to select elements normally.
if StickyLineDraw then
return
end
StickyLineDraw = true
local a = false
local b = false
local c, d = 0, 0
local e, f = 0, 0
local function g(h, i, j, k, l, m)
if not j and (i == 225 or i == 229 or h == 16) then
a = not a
tpt.log("Sticky line mode: " .. (a and "ON" or "OFF"))
end
end
local function n(o, p, q)
if q == 1 and a then
b = true
c, d = o, p
e, f = o, p
return false
end
end
local function r(o, p, s, t)
if b and a then
e, f = o, p
end
end
local function u(o, p, q, v)
if b and a and q == 1 then
b = false
local w, x = tpt.brushx, tpt.brushy
local y = tpt.brushID
sim.createLine(c, d, o, p, w, x, nil, y)
return false
end
end
local function z()
if a then
tpt.drawtext(10, 20, "Line mode locked", 255, 255, 0)
end
if b and a then
local w, x = tpt.brushx, tpt.brushy
tpt.drawline(c, d, e, f, 255, 255, 255, 120)
for t = -x, x do
tpt.drawline(c, d + t, e, f + t, 255, 255, 255, 40)
end
for s = -w, w do
tpt.drawline(c + s, d, e + s, f, 255, 255, 255, 40)
end
tpt.fillrect(c - w, d - x, w * 2, x * 2, 0, 255, 0, 100)
tpt.fillrect(e - w, f - x, w * 2, x * 2, 255, 0, 0, 100)
end
end
event.register(event.keypress, g)
event.register(event.mousedown, n)
event.register(event.mousemove, r)
event.register(event.mouseup, u)
event.register(event.tick, z)
Or you can start the brush at just 1 pixel by one pixel, then hold shift or ctrl will scrolling up with your mouse wheel to only extend the brush's length or width respectively. With this method, you can draw entire lines either horizontal or vertical with just the click of a mouse, instead of having to hold and drag the mouse.
I Use a Trackpad because I don't have a charger for the mouse
EDIT:
Thank you so much I'm going to use that as soon as I can!
Also how do you turn it off?
EDIT: For some reason it doesn't work well do oh I just looked at your message my problem is when I press shift for line tool I have to hold it which makes my thumb feel like spagettii, as if it's to far I have to guess by the line thing that i'm not going off the line but still thank you it helped a good bit
To turn it off, simply press Shift again; to completely disable the script, you need to delete it.
I was able to stop it by opening powder toy again and killing the old one but my problem is my hand hurts when me use the line tool as have to hold shift and hold down on my trackpad which hurts my hand and makes me unable to make stright [english is bad] lines
You can use alt (or option on mac) to make a perfectly straight line.