UIListLayout / Auto Scale Scrolling Frame Problem

Recently ive been making a new Dance Gui, and have been struggling with figuring out how I can make the scrolling part/scale part of the buttons to click.

ATM It is functioning like this - https://gyazo.com/25c47f249c5bacdb5834e94f11423330

What im looking for -

  1. Automatic scalling, so you can put as many buttons inside.
  2. Prev/Next Button that lets you click to go higher or lower on the CanvasPosition.

I’ve looked at many resources. Still don’t understand what is wrong.

Here is my code, for trying to fit all sizes/buttons & the prev/next button. (I also used AspectRatioConstraint’s for the buttons.)

local prevButton = GUI.Frame.prevButton -- Previous Button
local nextButton = GUI.Frame.nextButton -- Next Button
local CanvasPosition = Pages.CanvasPosition -- Canvas Position
local CanvasSize = Pages.CanvasSize -- Canvas Size
local UIListLayout = Pages.UIListLayout -- UI Grid Layout
CanvasSize = UDim2.new(0, 0, 1, UIListLayout.AbsoluteContentSize.Y) -- Canvas Size Automatic

--[[ PREV/NEXT FUNCTION ]]--

local ButtonY = 50 -- How Much You Wanna Scroll

prevButton.Activated:Connect(function()
	CanvasPosition = Vector2.new(0,CanvasPosition.Y - ButtonY)
end)

nextButton.Activated:Connect(function()
	CanvasPosition = Vector2.new(0,CanvasPosition.Y + ButtonY)
end)

image

1 Like

When you have a variable like this and do CanvasPosition = Vector2.new(somevalue) won’t change the property it will update your variable so what you have to do is Pages.CanvasPosition = Vector2.new(somevalue) same with CanvasSize, i hope this helps.

1 Like

Thankyou so much for that clarification. It got my “prevButton and nextButton” to work. But still having problems with →

Pages.CanvasSize = UDim2.new(0, 0, 1, Pages.UIListLayout.AbsoluteContentSize.Y) -- Canvas Size Automatic

How am I supposed to make the Scrolling Frame let me scroll longer, based on the UIList size?

1 Like

Are you adding frames from a script? Try doing this:

Pages.CanvasSize = UDim2.new(0, 0, 0, Pages.UIListLayout.AbsoluteContentSize.Y)
Pages.UIListLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
    Pages.CanvasSize = UDim2.new(0, 0, 0, Pages.UIListLayout.AbsoluteContentSize.Y)
end)
6 Likes