Class · inherits UIGridStyleLayout
UIPageLayout
Positions sibling UI elements as full-size pages in a single row or column that users can scroll or animate through one page at a time.
About UIPageLayout
Creates a paged viewing window, like the home screen of a mobile device. You can use a UIPageLayout by parenting it to a GuiObject. The UIPageLayout will then apply itself to all of its GuiObject siblings.
Properties 10
Animated
: booleanWhether or not to animate transitions between pages.When set to true, page transitions use the configured
UIPageLayout.EasingStyle,UIPageLayout.EasingDirection, andUIPageLayout.TweenTimeto animate the movement between pages. When set to false, page transitions are instantaneous. Defaults totrue.Circular
: booleanWhether or not the page layout wraps around at the ends.When set to true, navigating past the last page wraps around to the first page, and navigating before the first page wraps to the last. Animated transitions take the shortest rotational path around the wrap boundary. When set to false, navigation stops at the first and last pages. Defaults to
false.CurrentPage
: GuiObjectReadOnlyNotReplicatedThe page that is either currently being displayed or is the target of the current animation.A read-only reference to the
GuiObjectsibling that is currently displayed or is the target of an in-progress animation. The layout updates this property when pages change viaUIPageLayout.Next,UIPageLayout.Previous,UIPageLayout.JumpTo,UIPageLayout.JumpToIndex, or through user input (touch swipe, scroll wheel, or gamepad). If no page has been explicitly navigated to, it defaults to the first visibleGuiObjectsibling in layout order.EasingDirection
: EasingDirectionThe easing direction to use when performing an animation.Determines the direction component of the easing function applied during animated page transitions. Combined with
UIPageLayout.EasingStyleto form the full tween curve. Only takes effect whenUIPageLayout.Animatedis true. Defaults toEasingDirection.Out.EasingStyle
: EasingStyleThe easing style to use when performing an animation.Determines the easing curve applied during animated page transitions. Combined with
UIPageLayout.EasingDirectionto form the full tween curve. Only takes effect whenUIPageLayout.Animatedis true. Defaults toEasingStyle.Back.GamepadInputEnabled
: booleanControls the overrides ofNextSelection{Up, Down, Left, Right}. Defaults to true.When set to true, the layout overrides sibling
GuiObject.NextSelectionLeftandGuiObject.NextSelectionRight(for horizontal fill direction) orGuiObject.NextSelectionUpandGuiObject.NextSelectionDown(for vertical fill direction) so that gamepad directional navigation moves between pages. Additionally, the L1 and R1 bumper buttons advance to the previous and next page respectively. When false, gamepad input does not interact with the layout. Defaults totrue.Padding
: UDimDetermines the amount that pages are separated from each other by.Determines the amount that pages are separated from each other by. Can be set either using scale (Percentage of parent's size in the current direction) or offset (a static spacing value, similar to pixel size).
ScrollWheelInputEnabled
: booleanControls the use of scroll wheel, in case that it is intended for something else. Defaults to true.When set to true, mouse scroll wheel input navigates between pages. Scrolling up moves to the previous page and scrolling down moves to the next page. Set this to false when the scroll wheel is intended for other interactions in the UI. Defaults to
true.TouchInputEnabled
: booleanControls touch scrolling, in case this is a non-interactive layout. Defaults to true.When set to true, touch-based swipe gestures navigate between pages. Set this to false for layouts where touch input should not trigger page transitions, such as non-interactive displays. Defaults to
true.TweenTime
: floatThe length of the animation.The duration, in seconds, of the animated transition when navigating between pages. The value is clamped to a minimum of 0.01. Only takes effect when
UIPageLayout.Animatedis true. Defaults to1.
Methods 4
JumpTo
(page: Instance) → ()If thepageis in the UIPageLayout, then it setsUIPageLayout.CurrentPageto it and animates to it. If the circular layout is enabled, it will take the shortest path to this page.Navigates to a specific page within the layout. The
pageargument must be aGuiObjectthat is a visible sibling managed by this layout; passingnilor an instance that is not part of the layout throws an error. SetsUIPageLayout.CurrentPageto the target and animates the transition (or jumps instantly ifUIPageLayout.Animatedis false). WhenUIPageLayout.Circularis true, the animation takes the shortest rotational path to the target page.JumpToIndex
(index: int) → ()If the index is>= 0and less than the size of the layout, this method acts likeUIPageLayout.JumpTo. Out-of-bounds indices are wrapped modulo the page count to determine the target page.Navigates to the page at the given zero-based
indexin layout order. If the index is within the valid range (0 to page count minus 1), this method behaves likeUIPageLayout.JumpTo. Out-of-bounds indices are wrapped modulo the page count to determine the final page.Next
() → ()SetsUIPageLayout.CurrentPageto the page after the current page and animates to it, or does nothing if there isn't a next page.Advances
UIPageLayout.CurrentPageto the next page in layout order and animates the transition (or jumps instantly ifUIPageLayout.Animatedis false). If the current page is already the last page andUIPageLayout.Circularis false, this method does nothing. IfUIPageLayout.Circularis true, it wraps from the last page to the first.Previous
() → ()SetsUIPageLayout.CurrentPageto the page before the current page and animates to it, or does nothing if there isn't a previous page.Moves
UIPageLayout.CurrentPageto the previous page in layout order and animates the transition (or jumps instantly ifUIPageLayout.Animatedis false). If the current page is already the first page andUIPageLayout.Circularis false, this method does nothing. IfUIPageLayout.Circularis true, it wraps from the first page to the last.
Events 3
PageEnter
UIPageLayout.PageEnter:Connect(function(page))Fires when a page comes into view, and is going to be rendered.Fires when a sibling page's bounding rect begins intersecting the parent's clip region, causing it to become visible and rendered. The
pageparameter is theGuiObjectthat entered view. This event fires on the frame the page's visibility flips from hidden to shown, whether due to an animated transition, a programmatic jump, or user input scrolling.PageLeave
UIPageLayout.PageLeave:Connect(function(page))Fires when a page leaves view, and will not be rendered.Fires when a sibling page's bounding rect stops intersecting the parent's clip region, causing it to become hidden and no longer rendered. The
pageparameter is theGuiObjectthat left view. This event fires on the frame the page's visibility flips from shown to hidden, whether due to an animated transition, a programmatic jump, or user input scrolling.Stopped
UIPageLayout.Stopped:Connect(function(currentPage))Fires when an animation toUIPageLayout.CurrentPageis completed without being canceled, and the view stops scrolling.Fires when a page-navigation animation reaches its target without being interrupted by new input, and the view comes to rest. The
currentPageparameter is theGuiObjectnow displayed. This event does not fire for programmatic transitions made whileUIPageLayout.Animatedis false, since those snap to the target page instantly.
UIPageLayout also has every member of UIGridStyleLayout. Deprecated and Roblox-only members are hidden.
Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.