Unlike many UI frameworks, which use skin mechanisms to define scroll bars, in FairyGUI, scroll bars can be freely designed.Rolling containerIt is independent from the scroll bar, that is, even if there is no scroll bar, the scroll container can complete the scrolling function.
Note: The scroll bar cannot be dragged directly onto the stage, never do it.

Create scroll bar

There are two ways to create a scroll bar component.

Edit-mode properties

In the component editing state, the properties panel of the scrollbar component is:


Instance properties

There are two ways to use the scroll bar, one is to set it as a global scroll bar resource in “Project Properties”-> “Preview Settings”; the other is to set it in the properties of the scroll container. Either way, the scroll bar is created automatically and then adjusted according to the properties of the scroll container (seeRolling containerYou cannot select the scroll bar component for setting properties.


The type of the scrollbar component at runtime is GScrollBar, but you don’t need to access the GScrollBar object. All scroll related operations are done through ScrollPane, seeRolling container