#TextButton Size Not Changing

4 messages · Page 1 of 1 (latest)

fringe locust
#

The text buttons size is not changing hovered over. ```lua
local TweenService = game:GetService("TweenService")

local button = script.Parent
local Camera = workspace.CurrentCamera

local plr = game.Players.LocalPlayer

local char = plr.Character
local hum = char.Humanoid

local initialSize = button.Size

local tweenInfo = TweenInfo.new(0.35, Enum.EasingStyle.Quad)
local description = button.Description

-- Now Let's program the button!
button.MouseEnter:Connect(function()
TweenService:Create(description, tweenInfo, {TextTransparency = 0}):Play()
print(button.Size)
button:TweenSize(initialSize + UDim2.new(0, 0, 0, 40), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, 0.1, true)

end)

button.MouseLeave:Connect(function()
TweenService:Create(description, tweenInfo, {TextTransparency = 1}):Play()
button:TweenSize(initialSize, Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, 0.1, true)
end)

button.MouseButton1Click:Connect(function()
Camera.CameraSubject = hum
Camera.CameraType = Enum.CameraType.Custom
button:Destroy()
warn("MainMenuDestroyed")
end)```

pulsar trout
#

**local TweenService = game:GetService("TweenService")

local button = script.Parent
local Camera = workspace.CurrentCamera

local plr = game.Players.LocalPlayer

local char = plr.Character
local hum = char.Humanoid

local initialSize = button.Size

local tweenInfo = TweenInfo.new(0.35, Enum.EasingStyle.Quad)
local description = button.Description

button.MouseEnter:Connect(function()
TweenService:Create(description, tweenInfo, {TextTransparency = 0}):Play()
print(button.Size)
button.Size = initialSize + UDim2.new(0, 0, 0, 40)
end)

button.MouseLeave:Connect(function()
TweenService:Create(description, tweenInfo, {TextTransparency = 1}):Play()
button.Size = initialSize
end)

button.MouseButton1Click:Connect(function()
Camera.CameraSubject = hum
Camera.CameraType = Enum.CameraType.Custom
button:Destroy()
warn("MainMenuDestroyed")
end)**

#

try it

#

@fringe locust