This repository was archived by the owner on Jul 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathPenLibraryTestTool.lua
More file actions
165 lines (158 loc) · 2.6 KB
/
PenLibraryTestTool.lua
File metadata and controls
165 lines (158 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
local function Load(file)
return loadstring(game:HttpGet(string.format("https://raw.githubusercontent.com/zzerexx/scripts/main/%s.lua", file)), file)()
end
local Pen = Pen or Load("Libraries/Pen")
getgenv().Pen = Pen
local Material = Load("MaterialLuaRemake")
local UI = Material.Load({
Title = "Pen Library Test Tool",
SizeX = 400,
SizeY = 400,
Style = 3
})
local color = Color3.new(1,1,1)
local opacity = 1
local size = 2
local layer = 0
local b = UI.new("control")
local movestep = 1
b.Slider({
Text = "move relative step",
Callback = function(value)
movestep = value
end,
Min = 1,
Max = 100,
Def = 1
})
b.Dropdown({
Text = "move relative",
Callback = function(value)
if value == "up" then
Pen:moverel(0, -movestep)
elseif value == "down" then
Pen:moverel(0, movestep)
elseif value == "left" then
Pen:moverel(-movestep, 0)
elseif value == "right" then
Pen:moverel(movestep, 0)
end
end,
Options = {
"up",
"down",
"left",
"right"
}
})
b.TextField({
Text = "x position",
Type = "Default",
Callback = function(value)
Pen:moveabs(value, Pen.props.y)
end
})
b.TextField({
Text = "y position",
Type = "Default",
Callback = function(value)
Pen:moveabs(Pen.props.x, value)
end
})
b.Toggle({
Text = "pen down",
Callback = function(value)
if value then
Pen:down()
else
Pen:up()
end
end,
Enabled = false
})
b.ColorPicker({
Text = "color",
Callback = function(value)
color = value
end,
Def = color
})
b.Slider({
Text = "opacity",
Callback = function(value)
opacity = value
end,
Min = 0,
Max = 1,
Def = 1,
Decimals = 2
})
b.Slider({
Text = "size",
Callback = function(value)
size = value
end,
Min = 1,
Max = 100,
Def = size
})
b.Slider({
Text = "layer",
Callback = function(value)
layer = value
end,
Min = 0,
Max = 999,
Def = layer
})
b.Button({
Text = "undo",
Callback = function()
Pen:undo()
end
})
b.Button({
Text = "erase",
Callback = function()
Pen:erase()
end
})
b.Toggle({
Text = "pointer visible",
Callback = function(value)
Pen:pointer(value)
end,
Enabled = true
})
local mousecontrol = true
b.Toggle({
Text = "mouse control",
Callback = function(value)
mousecontrol = value
if value == false then
Pen:up()
end
end,
Enabled = true
})
local mouse = game.Players.LocalPlayer:GetMouse()
mouse.Button1Down:Connect(function()
if mousecontrol then
Pen:down()
end
end)
mouse.Button1Up:Connect(function()
if mousecontrol then
Pen:up()
end
end)
while true do
if mousecontrol then
Pen:color(color)
Pen:opacity(opacity)
Pen:size(size)
Pen:layer(layer)
Pen:moveabs(mouse.X, mouse.Y + 36)
end
task.wait()
end