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

Animated GUI Buttons, Similar to CSS Animated HTML Buttons?

Asked by 8 years ago

I'm a web based developer so this is confusing me a little. I know how to make a click-down animated button, similar to how ones like "Ask Question" are here on Scripting Helpers, it would be:

.button {
  padding: 15px 25px;
  font-size: 24px;
  text-align: center;
  cursor: pointer;
  outline: none;
  color: #fff;
  background-color: #4CAF50;
  border: none;
  border-radius: 15px;
  box-shadow: 0 9px #999;
}

.button:hover {background-color: #3e8e41}

.button:active {
  background-color: #3e8e41;
  box-shadow: 0 5px #666;
  transform: translateY(4px);
}

, However, i'm trying to do this in a GUI on ROBLOX. Is there any forum explaining animated GUIs, or can someone explain this to me a little? Thanks in advance.

0
Most people don't know this. irid_leas 97 — 8y

2 answers

Log in to vote
0
Answered by 8 years ago
Edited 8 years ago

It'd be hard for people who don't know HTML to understand this, so in future please try to explain what the functions do. But for the button:hover thing I think you're going towards something like

local button = script.Parent --Define the button
button.MouseEnter:connect(function() --Mouse hovers over
    button.BackgroundColor3 = Color3.new(62/255,142/255,65/255) --Change the Background color, always uses Color3
end)
button.MouseLeave:connect(function() --Mouse isn't hovering
    button.BackgroundColor3 = Color3.new(76/255,175/255,80/255) --Change the Background color, always uses Color3
end)

But for that translate and active thing, I'd have no clue.


Hope I helped

TheHospitalDev

To translate Hex codes to RGB codes which Lua uses, you could use this like I did

0
There's Color3.fromRGB now, so you can just do Color3.fromRGB(62, 142, 65). Pyrondon 2089 — 8y
0
Oooh, thanks for the info TheHospitalDev 1134 — 8y
0
I believe he's talking the animation once the button is pressed, but this is one part to it I guess yoshi8080 445 — 8y
Ad
Log in to vote
0
Answered by 8 years ago

Most users don't know how to make this. I'd rather ask a developer then Scripting Helpers.

Answer this question