Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- UI library
- local UI = {}
- function UI.CreateButton(parent, text, position, size, callback)
- -- Create a button object
- local button = Instance.new("TextButton")
- -- Set the button's properties
- button.Parent = parent
- button.Text = text
- button.Position = position
- button.Size = size
- button.Font = Enum.Font.SourceSans
- button.TextSize = 14
- button.TextColor3 = Color3.new(1, 1, 1)
- button.BackgroundColor3 = Color3.new(0.2, 0.2, 0.2)
- -- Set the callback function for the button's "MouseButton1Click" event
- button.MouseButton1Click:Connect(callback)
- -- Return the button object
- return button
- end
- function UI.CreateLabel(parent, text, position, size, fontSize)
- -- Create a label object
- local label = Instance.new("TextLabel")
- -- Set the label's properties
- label.Parent = parent
- label.Text = text
- label.Position = position
- label.Size = size
- label.Font = Enum.Font.SourceSans
- label.TextSize = fontSize or 14
- label.TextColor3 = Color3.new(1, 1, 1)
- label.BackgroundTransparency = 1
- -- Return the label object
- return label
- end
- function UI.CreateFrame(parent, position, size)
- -- Create a frame object
- local frame = Instance.new("Frame")
- -- Set the frame's properties
- frame.Parent = parent
- frame.Position = position
- frame.Size = size
- frame.BackgroundColor3 = Color3.new(0.2, 0.2, 0.2)
- -- Return the frame object
- return frame
- end
- return UI
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement