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 -
- Automatic scalling, so you can put as many buttons inside.
-
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)