#HELP with TopBarPlus

1 messages · Page 1 of 1 (latest)

meager path
#

local container = script.Parent
local Icon = require(container.Icon)

Icon.new()
:bindEvent("Selected", function()
setWidth = 54
end)
:disableStateOverlay(true)
:oneClick(bool)
:modifyTheme({
{"Widget", "MinimumWidth", 90},
{"IconCorners", "CornerRadius", UDim.new(0, 100)}
})

"Im trying to make my button shrink when clicked but i dont know how to do it can anyone help me please" the screenshot is the buttons from Ultimate Battlegrounds and as you can see when i click on it it shrinks and after clicking it goes back to its original size thats what im trying to do.

royal saddle
#
    :setImage(4882429582)
    :setLabel("Closed", "Deselected")
    :setLabel("Open", "Selected")
    :setLabel("Viewing", "Viewing")```?
meager path
#

nah i want to change the buttons width when its clicked

stiff perch
# meager path nah i want to change the buttons width when its clicked

To make a button shrink when clicked you could do this

local frame = script.Parent
local size = frame.Size
local TweenService = game:GetService("TweenService")
local shrink_size = UDim2.new(0, 5, 0, 5)

frame.MouseLeave:Connect(function()
TweenService:Create(frame, TweenInfo.new(0.1, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0), {Size = size}):Play()
end)

frame.MouseEnter:Connect(function()
TweenService:Create(frame, TweenInfo.new(0.1, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0),
{Size = UDim2.new(size.X.Scale, size.X.Offset - shrink_size.X.Offset, size.Y.Scale, size.Y.Offset - shrink_size.Y.Offset)}):Play()
end)

meager path
#

yeah but im using TopBarPlus i dont think it works the same way

stiff perch
#

I dont know how TopBarPlus works but maybe you cold set Icon.new() as the frame if that function returns a UI object

vocal acorn
#

if you really need to use topbarplus you can simply read their documentation (if they have one)

#

or search up a tutorial!

meager path
#

There's no tutorial for what I'm trying to do

vocal acorn
meager path
#

And the documentation is a bit hard for me to comprehend

royal saddle
#

:setLabel("Closed", "Deselected")
:setLabel("Open", "Selected")
:setLabel("Viewing", "Viewing") use this to set it's width no?