Sure of course!
for _, Button in pairs(CollectionService:GetTagged("WindowButton")) do
local debounce = false
local WindowOfChoice = Button:GetAttribute("Window")
local XPos = Button.Position.X
local YPos = Button.Position.Y
local hover = {}
hover.Size = UDim2.new(0.207, 0,0.062, 0)
hover.Position = UDim2.new(0.115,0,YPos.Scale, 0)
local leave = {}
leave.Size = UDim2.new(0.032, 0,0.071, 0)
leave.Position = UDim2.new(XPos.Scale,0,YPos.Scale,0)
local click = {}
click.Size = UDim2.new(0.03, 0, 0.064, 0)
click.Position = UDim2.new(XPos.Scale,0,YPos.Scale,0)
local fadeOutIMG = {}
fadeOutIMG.ImageTransparency = 1
local fadeInTXT = {}
fadeInTXT.TextTransparency = 0.1
local fadeInIMG = {}
fadeInIMG.ImageTransparency = 0.1
local fadeOutTXT = {}
fadeOutTXT.TextTransparency = 1
local tweenInfo2 = TweenInfo.new(
0.2,
Enum.EasingStyle.Circular,
Enum.EasingDirection.InOut
)
local entered = TweenService:Create(Button, tweenInfo2, hover)
local left = TweenService:Create(Button, tweenInfo2, leave)
local pressed = TweenService:Create(Button, tweenInfo2, click)
local FadeOutIMG = TweenService:Create(Button, tweenInfo2, fadeOutIMG)
local FadeInIMG = TweenService:Create(Button, tweenInfo2, fadeInIMG)
local FadeOutTXT = TweenService:Create(Button.Text, tweenInfo2, fadeOutTXT)
local FadeInTXT = TweenService:Create(Button.Text, tweenInfo2, fadeInTXT)
Button.MouseEnter:Connect(function()
workspace.Sound.UI.hover:Play()
--Button.Text.Visible = true
entered:Play()
FadeOutIMG:Play()
FadeInTXT:Play()
end)
Button.MouseLeave:Connect(function()
left:Play()
FadeInIMG:Play()
FadeOutTXT:Play()
end)
Button.MouseButton1Down:Connect(function()
workspace.Sound.UI.click:Play()
FadeOutTXT:Play()
FadeInIMG:Play()
pressed:Play()
if debounce == false then
if WindowManager.WindowInstance(WindowOfChoice).Visible == true then
debounce = true
GlobalUI.DeactivateButton(Button)
WindowManager.CloseWindow(WindowOfChoice)
debounce = false
else
debounce = true
GlobalUI.ActivateButton(Button)
WindowManager.OpenWindow(WindowOfChoice)
debounce = false
end
end
end)
Button.MouseButton1Up:Connect(function()
left:Play()
FadeInIMG:Play()
FadeOutTXT:Play()
end)
end
(This is in a CollectionService if the context is weird.)
Now that I think of it, I may have to change some values from the tweening. I’m going to try something in the meantime
Edit: Nevermind, I tried changing some values that compliment the new scale, to no avail. It keeps the Constraint’s aspect ratio. I’m assuming that somehow I need to disable the Aspect Ratio while it tweens then enable it again when it stops tweening.