Skip to content
ScrollBox

UI / ScrollBox

ScrollBox Class

Sliding frame

Hierarchy

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): void other
Set to allow scroll to exceed the size of scroll box
alwaysShowScrollBar(): boolean other
Get whether the scrollbar is always displayed
animationType(): UIScrollBoxAnimationType other
Get animation Type
defaultLocation(): ScrollBarDefaultLocation other
Return to the default position of the scroll bar (type, non specific coordinates)
elasticMultiplier(): number other
Obtain elasticity coefficient
onScrollEnd(): MulticastDelegate<() => void> other
Scroll End Event
onUserScrolled(): MulticastDelegate<(currentOffset: number) => void> other
Scroll Events
orientation(): Orientation other
Get scrolling direction
scrollAxisBrushDrawType(): Readonly<SlateBrushDrawType> other
Get scroll bar image drawing type
scrollAxisBrushGuid(): string other
Get scroll bar image ID
scrollAxisBrushMargin(): Readonly<Margin> other
Get scroll bar image margin
scrollAxisColor(): Readonly<LinearColor> other
Get scroll bar image color
scrollBarVisibility(): SlateVisibility other
Get the display and hide of scroll bar
scrollOffset(): number other
Get scroll box offset
scrollOffsetFraction(): number other
Get the offset ratio of the scroll box from the bottom
scrollOffsetOfEnd(): number other
Get the offset of the scroll box from the bottom
scrollWheelMultiplier(inScrollWheelMultiplier: number): void other
Set mouse wheel coefficient
scrollbarPadding(inScrollbarPadding: Margin): void other
Set scroll margin
scrollbarThickness(): number other
Get the thickness of scroll bar
shadowVisibility(): SlateVisibility other
Obtain shadow display
smoothScrollingEnable(isSmoothScrolling: boolean): void other
Set whether the scroll speed is interpolated when mouse scroll to limit the scroll speed to be smoother
supportElastic(): boolean other
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(): boolean other
Get whether to automatically set the size horizontally
autoSizeVerticalEnable(): boolean other
Get whether to set the size automatically vertical
cachedGeometry(): Geometry other
Get the previous Get TickSpaceGeometry
constraints(): Readonly<UIConstraintAnchors> other
Get the layout of the control
desiredSize(): Vector2 other
Obtain expected size
enable(): boolean other
Is it available
guid(): string other
Get the widget GUID
isHovered(): boolean other
Is it hovered
mouseCursor(): MouseCursor other
Get the cursor type on the widget
name(): string other
Get Name
paintSpaceGeometry(): Geometry other
Get the last geometric information used to render the Widget
parent(): Widget other
Get parent node
pivot(): Vector2 other
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(): number other
Obtain rendering transparency
renderScale(): Vector2 other
Get rendering scaling
renderShear(): Vector2 other
Obtain rendering misalignment deformation
renderTransformAngle(): number other
Obtain the rendering angle
renderTransformPivot(): Vector2 other
Get Render anchor
size(): Vector2 other
Get size
tickSpaceGeometry(): Geometry other
Retrieve the last geometric information used to drive Widget Tick
transform(): Readonly<UITransform> other
Obtain the size and position of the control
visibility(): SlateVisibility other
Get visibility
visible(): boolean other
Is it visible
zOrder(): number other
Get Zorder

Methods

endInertialScrolling(): void other
Stop scroll now
scrollToEnd(): void other
Scroll to the bottom
scrollToStart(): void other
Scroll to start position
newObject(parent?: Canvas, inName?: string): ScrollBox other
Create ScrollBox widget
click

Methods

addChild(child: Widget): void other
Add child nodes
clone(position: Vector2, Parent?: any): Widget other
Clone the UI widget and its child nodes to the specified parent widget position (default to its parent node)
destroyObject(): void other
Remove and destroy immediately. Cannot be used again
equal(that: Widget): boolean other
Determine if it is the same object
findChildByPath(inPath: string): Widget other
Find nodes by relative path
getChildAt(index: number): Widget other
What is the position node to obtain
getChildByName<T: extends Widget<T>>(name: string): T: extends Widget<T> other
Search for nodes by name
getChildrenCount(): number other
Obtain the number of child nodes
getCustomProperties(): string[] other
Get all customize property
getCustomProperty<T: extends CustomPropertyType>(propertyName: string): T: extends CustomPropertyType other
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(): void other
Immediately trigger re rendering and layout calculation
removeAllChildren(): void other
Clearing all child nodes will destroy the UI and render it unusable
removeChild(child: Widget): void other
Removing a node will destroy the UI and make it unusable
removeChildAt(index: number): void other
Removing the third node will destroy the UI and render it unusable
removeObject(): void other
Immediately remove and add to the root node for reuse
serialize(): string other
Serialize UI widget
setCustomProperty(propertyName: string, value: undefined CustomPropertyType): void other
Set custom attributes
deserialize(Data: string, Parent?: Widget): Widget other
Deserialize UI

Properties

Accessors


allowOverscroll

set allowOverscroll(isAllowOverscroll): void other

Set to allow scroll to exceed the size of scroll box

Parameters

isAllowOverscroll booleanUsage: Allow scroll to exceed the size of scroll box

alwaysShowScrollBar

get alwaysShowScrollBar(): boolean other

set alwaysShowScrollBar(isScrollBarAlwaysShown): void other

Get whether the scrollbar is always displayed

Returns

booleanWhether the scroll bar is always displayed

Set whether to always display the scrollbar

Parameters

isScrollBarAlwaysShown booleanUsage: Does the scrollbar always display

animationType

get animationType(): UIScrollBoxAnimationType other

set animationType(inAnimationType): void other

Get animation Type

Returns

UIScrollBoxAnimationTypeAnimation Type

Set animation type

Parameters

inAnimationType UIScrollBoxAnimationTypeUsage: Type

Animation Type


defaultLocation

get defaultLocation(): ScrollBarDefaultLocation other

set defaultLocation(NewDefaultLocation): void other

Return to the default position of the scroll bar (type, non specific coordinates)

Precautions

The default position of the scrollbar without operating it

Returns

ScrollBarDefaultLocationReturn to the default position of the scroll bar (type, non specific coordinates)

Set the default position of the scroll bar (type, non specific coordinates)

Precautions

The default position of the scrollbar without operating it

Parameters

NewDefaultLocation ScrollBarDefaultLocationUsage: default position of scroll bar (type, non specific coordinates)

elasticMultiplier

get elasticMultiplier(): number other

set elasticMultiplier(inElasticMultiplier): void other

Obtain elasticity coefficient

Returns

numberElastic coefficient

Set elasticity coefficient

Parameters

inElasticMultiplier numberUsage: coefficient

Elastic coefficient


onScrollEnd

get onScrollEnd(): MulticastDelegate<() => void> other

Scroll End Event

Returns

MulticastDelegate<() => void>Scroll End Event

onUserScrolled

get onUserScrolled(): MulticastDelegate<(currentOffset: number) => void> other

Scroll Events

Returns

MulticastDelegate<(currentOffset: number) => void>Scroll Events

orientation

get orientation(): Orientation other

set orientation(inOrientation): void other

Get scrolling direction

Returns

OrientationScroll Direction

Set scroll direction

Parameters

inOrientation OrientationUsage: Direction

Scroll Direction


scrollAxisBrushDrawType

get scrollAxisBrushDrawType(): Readonly<SlateBrushDrawType> other

set scrollAxisBrushDrawType(InDrawAs): void other

Get scroll bar image drawing type

Returns

Readonly<SlateBrushDrawType>Image drawing type

Set image Drawing Type

Parameters

InDrawAs SlateBrushDrawTypeUsage: Image drawing type

scrollAxisBrushGuid

get scrollAxisBrushGuid(): string other

set scrollAxisBrushGuid(InGUID): void other

Get scroll bar image ID

Returns

stringScroll bar image ID

Set scroll bar image ID

Parameters

InGUID stringUsage: image ID

scrollAxisBrushMargin

get scrollAxisBrushMargin(): Readonly<Margin> other

set scrollAxisBrushMargin(InMargin): void other

Get scroll bar image margin

Returns

Readonly<Margin>Scroll bar image margin

Set scroll bar image margin

Parameters

InMargin MarginUsage: scrollbar image margin

scrollAxisColor

get scrollAxisColor(): Readonly<LinearColor> other

set scrollAxisColor(InColor): void other

Get scroll bar image color

Returns

Readonly<LinearColor>Scroll bar image color, Type.LinearColor type, data range 0~1

Set scroll bar image color

Parameters

InColor LinearColorUsage: scrollbar image color, TypeLinearColor type, data range 0~1

scrollBarVisibility

get scrollBarVisibility(): SlateVisibility other

set scrollBarVisibility(inScrollBarVisibility): void other

Get the display and hide of scroll bar

Returns

SlateVisibilityThe display of the scroll bar is hidden

To make the scrollbar visible, it must be set to false in SetAlwaysShowScrollbar for it to take effect

Parameters

inScrollBarVisibility SlateVisibilityUsage: Is the scrollbar visible

scrollOffset

get scrollOffset(): number other

set scrollOffset(inScrollOffset): void other

Get scroll box offset

Returns

numberScroll box offset

Set the scrolling offset of the scroll box

Parameters

inScrollOffset numberUsage: scroll offset

scrollOffsetFraction

get scrollOffsetFraction(): number other

Get the offset ratio of the scroll box from the bottom

Returns

numberScroll box offset ratio

scrollOffsetOfEnd

get scrollOffsetOfEnd(): number other

Get the offset of the scroll box from the bottom

Returns

numberScroll box offset

scrollWheelMultiplier

set scrollWheelMultiplier(inScrollWheelMultiplier): void other

Set mouse wheel coefficient

Parameters

inScrollWheelMultiplier numberUsage: coefficient

Mouse Wheel coefficient


scrollbarPadding

set scrollbarPadding(inScrollbarPadding): void other

Set scroll margin

Parameters

inScrollbarPadding MarginUsage: scrollbar margin

scrollbarThickness

get scrollbarThickness(): number other

set scrollbarThickness(inScrollbarThickness): void other

Get the thickness of scroll bar

Returns

numberScroll Bar Thickness

Set the thickness of the scroll bar

Parameters

inScrollbarThickness numberUsage: Thickness of scrollbar

shadowVisibility

get shadowVisibility(): SlateVisibility other

set shadowVisibility(inVisibility): void other

Obtain shadow display

Returns

SlateVisibilityShadow display

Set shadow display

Parameters

inVisibility SlateVisibilityShadow display

Shadow display


smoothScrollingEnable

set smoothScrollingEnable(isSmoothScrolling): void other

Set whether the scroll speed is interpolated when mouse scroll to limit the scroll speed to be smoother

Parameters

isSmoothScrolling booleanUsage: Does the scrolling speed interpolate when the mouse is scrolling

supportElastic

get supportElastic(): boolean other

set supportElastic(inSupportElastic): void other

Judge whether support inertia

Returns

booleanWhether support inertia

Set whether support inertia

Parameters

inSupportElastic booleanUsage: inertia

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? CanvasUsage: Create the external parent object of the control with default: null
inName? stringUsage: name of the create widget default: null range: set a reasonable name

Returns

ScrollBoxCreated objects

When the parent and inName are the same as an existing object, the old object will be destroyed