A Ui module that I made

So I made this module and I think its pretty cool.

If people like it and there isn’t something like it I will make it open sourced once I’m done.

The module allows you to do this like this:
https://i.gyazo.com/f4e5dc758f7193434d94a6285c277f25.mp4

Which would usually take this amount of code:

local TextButton = script.Parent

TextButton.MouseEnter:Connect(function()
	TextButton:TweenSize(UDim2.new(0.21,0,0.11,0), "In", "Quad", 0.1, true)
end)

TextButton.MouseLeave:Connect(function()
	TextButton:TweenSize(UDim2.new(0.2,0,0.1,0), "In", "Quad", 0.1, true)
end)

To:

local UserInterface = require(game.ReplicatedStorage.UserInterface)

local TextButton, TextButtonObject = UserInterface.new(script.Parent)

TextButtonObject:Configuire("Hover", "Grow", 0.01)

There are 2 things that I like about the module;

Once you have this variable:

local TextButton, TextButtonObject = UserInterface.new(script.Parent)

You can something like this:

TextButtonObject:Configuire("Hover", "Grow", 0.01)
TextButtonObject("Hover", "TextColor", Color3.fromRGB(255, 0, 0))

Now when you hover you mouse over the ui object, it will grow in size and the text color will change the what you put as the parameter.

The second thing is that you can add your own functions.

Like I said I will make this open sourced if people like it and if there isn’t something like this.

5 Likes

Looks great! Nice job! Very simple and helpful for beginners!

2 Likes

I made it opened source: