UI / ScrollBox
ScrollBox Class 
Sliding frame
Hierarchy 
- ↳ - ScrollBox
Table of contents 
Properties 
click
Properties 
| onCustomPropertyChange: Readonly<MulticastDelegate<(path:string,value:unknown,oldValue:unknown) =>void>> other | 
|---|
| Monitor custom attribute synchronization events | 
Accessors 
| allowOverscroll( isAllowOverscroll:boolean):voidother | 
|---|
| Set to allow scroll to exceed the size of scroll box | 
| alwaysShowScrollBar(): booleanother | 
| Get whether the scrollbar is always displayed | 
| animationType(): UIScrollBoxAnimationTypeother | 
| Get animation Type | 
| defaultLocation(): ScrollBarDefaultLocationother | 
| Return to the default position of the scroll bar (type, non specific coordinates) | 
| elasticMultiplier(): numberother | 
| Obtain elasticity coefficient | 
| onScrollEnd(): MulticastDelegate<() =>void> other | 
| Scroll End Event | 
| onUserScrolled(): MulticastDelegate<(currentOffset:number) =>void> other | 
| Scroll Events | 
| orientation(): Orientationother | 
| Get scrolling direction | 
| scrollAxisBrushDrawType(): Readonly<SlateBrushDrawType> other | 
| Get scroll bar image drawing type | 
| scrollAxisBrushGuid(): stringother | 
| Get scroll bar image ID | 
| scrollAxisBrushMargin(): Readonly<Margin> other | 
| Get scroll bar image margin | 
| scrollAxisColor(): Readonly<LinearColor> other | 
| Get scroll bar image color | 
| scrollBarVisibility(): SlateVisibilityother | 
| Get the display and hide of scroll bar | 
| scrollOffset(): numberother | 
| Get scroll box offset | 
| scrollOffsetFraction(): numberother | 
| Get the offset ratio of the scroll box from the bottom | 
| scrollOffsetOfEnd(): numberother | 
| Get the offset of the scroll box from the bottom | 
| scrollWheelMultiplier( inScrollWheelMultiplier:number):voidother | 
| Set mouse wheel coefficient | 
| scrollbarPadding( inScrollbarPadding:Margin):voidother | 
| Set scroll margin | 
| scrollbarThickness(): numberother | 
| Get the thickness of scroll bar | 
| shadowVisibility(): SlateVisibilityother | 
| Obtain shadow display | 
| smoothScrollingEnable( isSmoothScrolling:boolean):voidother | 
| Set whether the scroll speed is interpolated when mouse scroll to limit the scroll speed to be smoother | 
| supportElastic(): booleanother | 
| Judge whether support inertia | 
click
Accessors 
| alignPosition(): Readonly<Vector2> other | 
|---|
| Get the align position of the widget. When the align method is right align, bottom align, and center align, the value of alignPosition is different from that of position; | 
| autoSizeHorizontalEnable(): booleanother | 
| Get whether to automatically set the size horizontally | 
| autoSizeVerticalEnable(): booleanother | 
| Get whether to set the size automatically vertical | 
| cachedGeometry(): Geometryother | 
| Get the previous Get TickSpaceGeometry | 
| constraints(): Readonly<UIConstraintAnchors> other | 
| Get the layout of the control | 
| desiredSize(): Vector2other | 
| Obtain expected size | 
| enable(): booleanother | 
| Is it available | 
| guid(): stringother | 
| Get the widget GUID | 
| isHovered(): booleanother | 
| Is it hovered | 
| mouseCursor(): MouseCursorother | 
| Get the cursor type on the widget | 
| name(): stringother | 
| Get Name | 
| paintSpaceGeometry(): Geometryother | 
| Get the last geometric information used to render the Widget | 
| parent(): Widgetother | 
| Get parent node | 
| pivot(): Vector2other | 
| Get the position of the widget anchor. This property determine the relative position of the widget graph and the anchor; At (0,0), the anchor point is located in the upper left corner of the control; (0.5,0.5), the anchor is at the center of the widget | 
| position(): Readonly<Vector2> other | 
| Get the position of the control | 
| renderOpacity(): numberother | 
| Obtain rendering transparency | 
| renderScale(): Vector2other | 
| Get rendering scaling | 
| renderShear(): Vector2other | 
| Obtain rendering misalignment deformation | 
| renderTransformAngle(): numberother | 
| Obtain the rendering angle | 
| renderTransformPivot(): Vector2other | 
| Get Render anchor | 
| size(): Vector2other | 
| Get size | 
| tickSpaceGeometry(): Geometryother | 
| Retrieve the last geometric information used to drive Widget Tick | 
| transform(): Readonly<UITransform> other | 
| Obtain the size and position of the control | 
| visibility(): SlateVisibilityother | 
| Get visibility | 
| visible(): booleanother | 
| Is it visible | 
| zOrder(): numberother | 
| Get Zorder | 
Methods 
| endInertialScrolling(): voidother | 
|---|
| Stop scroll now | 
| scrollToEnd(): voidother | 
| Scroll to the bottom | 
| scrollToStart(): voidother | 
| Scroll to start position | 
| newObject( parent?:Canvas,inName?:string):ScrollBoxother | 
| Create ScrollBox widget | 
click
Methods 
| addChild( child:Widget):voidother | 
|---|
| Add child nodes | 
| clone( position:Vector2,Parent?:any):Widgetother | 
| Clone the UI widget and its child nodes to the specified parent widget position (default to its parent node) | 
| destroyObject(): voidother | 
| Remove and destroy immediately. Cannot be used again | 
| equal( that:Widget):booleanother | 
| Determine if it is the same object | 
| findChildByPath( inPath:string):Widgetother | 
| Find nodes by relative path | 
| getChildAt( index:number):Widgetother | 
| What is the position node to obtain | 
| getChildByName< T: extendsWidget<T>>(name:string):T: extendsWidget<T> other | 
| Search for nodes by name | 
| getChildrenCount(): numberother | 
| Obtain the number of child nodes | 
| getCustomProperties(): string[] other | 
| Get all customize property | 
| getCustomProperty< T: extendsCustomPropertyType>(propertyName:string):T: extendsCustomPropertyTypeother | 
| Get customize property | 
| getCustomPropertyChangeDelegate( property):Readonly<MulticastDelegate<(path:string,value:unknown,oldValue:unknown) =>void>> other | 
| Event proxy triggered when a given object property is modified | 
| invalidateLayoutAndVolatility(): voidother | 
| Immediately trigger re rendering and layout calculation | 
| removeAllChildren(): voidother | 
| Clearing all child nodes will destroy the UI and render it unusable | 
| removeChild( child:Widget):voidother | 
| Removing a node will destroy the UI and make it unusable | 
| removeChildAt( index:number):voidother | 
| Removing the third node will destroy the UI and render it unusable | 
| removeObject(): voidother | 
| Immediately remove and add to the root node for reuse | 
| serialize(): stringother | 
| Serialize UI widget | 
| setCustomProperty( propertyName:string,value:undefinedCustomPropertyType):voidother | 
| Set custom attributes | 
| deserialize( Data:string,Parent?:Widget):Widgetother | 
| Deserialize UI | 
Properties 
Accessors 
allowOverscroll 
| •  | ||
|---|---|---|
| Set to allow scroll to exceed the size of scroll box Parameters 
 | 
alwaysShowScrollBar 
| •  | •  | ||||
|---|---|---|---|---|---|
| Get whether the scrollbar is always displayed Returns 
 | Set whether to always display the scrollbar Parameters 
 | 
animationType 
| •  | •  | ||||
|---|---|---|---|---|---|
| Get animation Type Returns 
 | Set animation type Parameters 
 Animation Type | 
defaultLocation 
| •  | •  | ||||
|---|---|---|---|---|---|
| Return to the default position of the scroll bar (type, non specific coordinates) Precautions The default position of the scrollbar without operating it Returns 
 | Set the default position of the scroll bar (type, non specific coordinates) Precautions The default position of the scrollbar without operating it Parameters 
 | 
elasticMultiplier 
| •  | •  | ||||
|---|---|---|---|---|---|
| Obtain elasticity coefficient Returns 
 | Set elasticity coefficient Parameters 
 Elastic coefficient | 
onScrollEnd 
| •  | ||
|---|---|---|
| Scroll End Event Returns 
 | 
onUserScrolled 
| •  | ||
|---|---|---|
| Scroll Events Returns 
 | 
orientation 
| •  | •  | ||||
|---|---|---|---|---|---|
| Get scrolling direction Returns 
 | Set scroll direction Parameters 
 Scroll Direction | 
scrollAxisBrushDrawType 
| •  | •  | ||||
|---|---|---|---|---|---|
| Get scroll bar image drawing type Returns 
 | Set image Drawing Type Parameters 
 | 
scrollAxisBrushGuid 
| •  | •  | ||||
|---|---|---|---|---|---|
| Get scroll bar image ID Returns 
 | Set scroll bar image ID Parameters 
 | 
scrollAxisBrushMargin 
| •  | •  | ||||
|---|---|---|---|---|---|
| Get scroll bar image margin Returns 
 | Set scroll bar image margin Parameters 
 | 
scrollAxisColor 
| •  | •  | ||||
|---|---|---|---|---|---|
| Get scroll bar image color Returns 
 | Set scroll bar image color Parameters 
 | 
scrollBarVisibility 
| •  | •  | ||||
|---|---|---|---|---|---|
| Get the display and hide of scroll bar Returns 
 | To make the scrollbar visible, it must be set to false in SetAlwaysShowScrollbar for it to take effect Parameters 
 | 
scrollOffset 
| •  | •  | ||||
|---|---|---|---|---|---|
| Get scroll box offset Returns 
 | Set the scrolling offset of the scroll box Parameters 
 | 
scrollOffsetFraction 
| •  | ||
|---|---|---|
| Get the offset ratio of the scroll box from the bottom Returns 
 | 
scrollOffsetOfEnd 
| •  | ||
|---|---|---|
| Get the offset of the scroll box from the bottom Returns 
 | 
scrollWheelMultiplier 
| •  | ||
|---|---|---|
| Set mouse wheel coefficient Parameters 
 Mouse Wheel coefficient | 
scrollbarPadding 
| •  | ||
|---|---|---|
| Set scroll margin Parameters 
 | 
scrollbarThickness 
| •  | •  | ||||
|---|---|---|---|---|---|
| Get the thickness of scroll bar Returns 
 | Set the thickness of the scroll bar Parameters 
 | 
shadowVisibility 
| •  | •  | ||||
|---|---|---|---|---|---|
| Obtain shadow display Returns 
 | Set shadow display Parameters 
 Shadow display | 
smoothScrollingEnable 
| •  | ||
|---|---|---|
| Set whether the scroll speed is interpolated when mouse scroll to limit the scroll speed to be smoother Parameters 
 | 
supportElastic 
| •  | •  | ||||
|---|---|---|---|---|---|
| Judge whether support inertia Returns 
 | Set whether support inertia Parameters 
 | 
Whether support inertia
Methods 
endInertialScrolling 
• endInertialScrolling(): void other
Stop scroll now
scrollToEnd 
• scrollToEnd(): void other
Scroll to the bottom
scrollToStart 
• scrollToStart(): void other
Scroll to start position
newObject 
• Static newObject(parent?, inName?): ScrollBox other
Create ScrollBox widget
Parameters 
| parent?Canvas | Usage: Create the external parent object of the control with default: null | 
|---|---|
| inName?string | Usage: name of the create widget default: null range: set a reasonable name | 
Returns 
| ScrollBox | Created objects | 
|---|
When the parent and inName are the same as an existing object, the old object will be destroyed
 Editor API
Editor API