the frame issue incident
just kidding
anyway, no more jokes(?)
the issue is this,
as you can see, for a second in the start you see
right in order.
selected, hovered, normal
but later on, you’ll see the third one just doesn’t even work, the 2nd is kinda broken and so is the first, the intended behaviour is something like this:
but it defintely isn’t anywhere there (yes yes i know… this illustration is INSANE!!!)
but anyway, here’s the code
local TweenService = game:GetService("TweenService")
local TweenInfo_ = TweenInfo.new(0.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local Topbar = script.Parent
local one = Topbar.one
local two = Topbar.two
local three = Topbar.three
function Clicked(which)
TweenService:Create(which, TweenInfo_, { BackgroundColor3 = Color3.fromRGB(52, 53, 58) , TextColor3 = Color3.fromRGB(255,255,255)}):Play()
end
function Selected(which)
TweenService:Create(which, TweenInfo_, { BackgroundColor3 = Color3.fromRGB(45, 46, 50) , TextColor3 = Color3.fromRGB(225,225,225)}):Play()
end
function Normal(which)
TweenService:Create(which, TweenInfo_, { BackgroundColor3 = Color3.fromRGB(40, 41, 45) , TextColor3 = Color3.fromRGB(166,166,166)}):Play()
end
one.MouseButton1Click:Connect(function()
Clicked(one)
Normal(two)
Normal(three)
end)
one.MouseEnter:Connect(function()
Selected(one)
Normal(three)
Normal(two)
end)
one.MouseLeave:Connect(function()
Normal(one)
Normal(three)
Normal(two)
end)
two.MouseButton1Click:Connect(function()
Normal(one)
Clicked(two)
Normal(three)
end)
two.MouseEnter:Connect(function()
Normal(one)
Normal(three)
Selected(two)
end)
two.MouseLeave:Connect(function()
Normal(one)
Normal(three)
Normal(two)
end)
two.MouseButton1Click:Connect(function()
Normal(one)
Normal(two)
Clicked(three)
end)
two.MouseEnter:Connect(function()
Normal(one)
Selected(three)
Normal(two)
end)
three.MouseLeave:Connect(function()
Normal(one)
Normal(three)
Normal(two)
end)
p.s. if someone could help me fix the mouseleave make everything normal BUT the currently selected it’d be gladly appreciated
thanks!