-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathui-lib.luaU
More file actions
105 lines (87 loc) · 3.62 KB
/
ui-lib.luaU
File metadata and controls
105 lines (87 loc) · 3.62 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
-- Gui to Lua
-- Version: 3.2
-- Instances:
local ScreenGui = Instance.new("ScreenGui")
local main = Instance.new("Frame")
local TextLabel = Instance.new("TextLabel")
local UIGradient = Instance.new("UIGradient")
local ImageButton = Instance.new("ImageButton")
local UICorner = Instance.new("UICorner")
local UIGradient_2 = Instance.new("UIGradient")
local borderline = Instance.new("Frame")
local UIGradient_3 = Instance.new("UIGradient")
local UserInputService = game:GetService("UserInputService")
--Properties:
ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
main.Name = "main"
main.Parent = ScreenGui
main.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
main.Position = UDim2.new(0.620363712, 0, 0.334811538, 0)
main.Size = UDim2.new(0, 474, 0, 305)
main.Active = true;
local dragging
local dragInput
local dragStart
local startPos
local function update(input)
local delta = input.Position - dragStart
main:TweenPosition(UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, 0.04, true) -- This is what I changed
end
main.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
dragging = true
dragStart = input.Position
startPos = main.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragging = false
end
end)
end
end)
main.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
dragInput = input
end
end)
UserInputService.InputChanged:Connect(function(input)
if input == dragInput and dragging then
update(input)
end
end)
TextLabel.Parent = main
TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
TextLabel.BackgroundTransparency = 1.000
TextLabel.BorderColor3 = Color3.fromRGB(0, 0, 0)
TextLabel.BorderSizePixel = 5
TextLabel.Size = UDim2.new(0, 474, 0, 35)
TextLabel.Font = Enum.Font.Code
TextLabel.Text = "UI LIB"
TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
TextLabel.TextSize = 16.000
TextLabel.TextWrapped = true
TextLabel.TextXAlignment = Enum.TextXAlignment.Middle
UIGradient.Parent = TextLabel
ImageButton.Parent = main
ImageButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
ImageButton.BackgroundTransparency = 0.500
ImageButton.BorderColor3 = Color3.fromRGB(170, 0, 0)
ImageButton.BorderSizePixel = 0
ImageButton.Position = UDim2.new(0.44725737, 0, 0.83606559, 0)
ImageButton.Size = UDim2.new(0, 50, 0, 50)
ImageButton.Image = "rbxasset://textures/ui/GuiImagePlaceholder.png"
UICorner.CornerRadius = UDim.new(0, 30)
UICorner.Parent = ImageButton
UIGradient_2.Rotation = -45
UIGradient_2.Transparency = NumberSequence.new{NumberSequenceKeypoint.new(0.00, 0.00), NumberSequenceKeypoint.new(0.00, 0.31), NumberSequenceKeypoint.new(0.00, 0.58), NumberSequenceKeypoint.new(0.50, 0.60), NumberSequenceKeypoint.new(1.00, 1.00)}
UIGradient_2.Parent = ImageButton
borderline.Name = "borderline"
borderline.Parent = main
borderline.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
borderline.Position = UDim2.new(-0.0126919644, 0, -0.0226600524, 0)
borderline.Size = UDim2.new(0, 486, 0, 323)
borderline.ZIndex = 0
UIGradient_3.Color = ColorSequence.new{ColorSequenceKeypoint.new(0.00, Color3.fromRGB(170, 0, 0)), ColorSequenceKeypoint.new(1.00, Color3.fromRGB(170, 0, 0))}
UIGradient_3.Rotation = 90
UIGradient_3.Transparency = NumberSequence.new{NumberSequenceKeypoint.new(0.00, 0.00), NumberSequenceKeypoint.new(1.00, 1.00)}
UIGradient_3.Parent = borderline