Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to add a float effect to GUI?

Asked by 4 years ago

I am aware you cannot request for scripts on this site but trust me, I have searched long and wide on Google, DevForum and ScriptingHelpers and the only thing that came up is how to make Billboard GUIs. :/

What I am looking for is how to, on mouse hover, make the GUI grow and change color. Would this use tweening or is there a float function in GUI objects? Could someone show me an example?

Thanks in advance,

- PrismaticFruits

0
do you mean Billboard GUI? raid6n 2196 — 4y
0
Maybe, this might help you. JackyW9cky 27 — 4y
0
i have no idea what you mean by floating gui raid6n 2196 — 4y
0
do you mean, making a gui grow when u hover over it? JackyW9cky 27 — 4y

3 answers

Log in to vote
1
Answered by 4 years ago

Although they provided a solution, a better way would be to use TweenService so you could change both the size and color at the same time.

TweenService:Create(Frame, TweenInfo.new(1, Enum.EasingStyle.Cubic, Enum.EasingDirection.Out), {Size = UDim2.new(1, 0, 1, 0), BackgroundColor = Color3.fromRGB(0, 0, 0)}):Play()
Ad
Log in to vote
1
Answered by
Dexiber 272 Moderation Voter
4 years ago

Maybe try this:

local buttton = --Define your Button

button.MouseEnter:Connect(function() --This event fires once the player's mouse hovers over.
    --Code here
end)

button.MouseLeave:Connect(function() -- This event fires once the player's mouse leaves.
    --Code here
end)

Hope this helps as an example!

Log in to vote
1
Answered by 4 years ago

I think this is what you need by reading what you said:

So, to make something do something do something when your mouse hovers over something, you use MouseEnter. MouseEnter is just saying in other words, your mouse is hovering over something.

So, this is an example of what I mean:

local button = script.Parent

button.MouseEnter:Connect(function()
   button:TweenSize(UDim2.new(0, 289, 0, 106), "In", "Sine", .5)
end)

and to make it go back to it's normal size again when your done hovering over the gui, this is what you type:

local button = script.Parent

button.MouseEnter:Connect(function()
   button:TweenSize(UDim2.new(0, 289, 0, 106), "In", "Sine", .5)
end)

button.MouseLeave:Connect(function()
   button:TweenSize(UDim2.new(0, 200, 0, 50), "In", "Sine", .5)
end)

I hope this helped :D

0
Thanks. PrismaticFruits 842 — 4y

Answer this question