ScrollViewNode
Defined in: ui/src/ScrollView.ts:67
A clipped, scrollable viewport that owns a normal Yoga child subtree.
Unlike the imperative @pixi/ui wrappers, this is a true
UIContainerElement: children are first-class Yoga nodes laid out by the
existing layout pass, so it works identically via the React reconciler
(<ScrollView>), the PanelNode builder (.scrollView()), or direct
addElement. Content overflowing the viewport on the scroll axis is
clipped by a mask and panned by a wheel/drag-driven offset that survives
re-renders (the node instance is stable; only children are diffed).
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ScrollViewNode(
props):ScrollViewNode
Defined in: ui/src/ScrollView.ts:104
Parameters
Section titled “Parameters”Returns
Section titled “Returns”ScrollViewNode
Properties
Section titled “Properties”yogaNode
Section titled “yogaNode”
readonlyyogaNode:Node
Defined in: ui/src/ScrollView.ts:68
Implementation of
Section titled “Implementation of”Accessors
Section titled “Accessors”children
Section titled “children”Get Signature
Section titled “Get Signature”get children(): readonly
UIElement[]
Defined in: ui/src/ScrollView.ts:172
Returns
Section titled “Returns”readonly UIElement[]
Implementation of
Section titled “Implementation of”displayObject
Section titled “displayObject”Get Signature
Section titled “Get Signature”get displayObject():
Container
Defined in: ui/src/ScrollView.ts:100
Returns
Section titled “Returns”Container
Implementation of
Section titled “Implementation of”UIContainerElement.displayObject
maxScroll
Section titled “maxScroll”Get Signature
Section titled “Get Signature”get maxScroll():
number
Defined in: ui/src/ScrollView.ts:196
Maximum scrollable offset (content overflow), computed each layout.
Returns
Section titled “Returns”number
scrollbarGutter
Section titled “scrollbarGutter”Get Signature
Section titled “Get Signature”get scrollbarGutter():
number
Defined in: ui/src/ScrollView.ts:204
Px reserved on the scroll-cross edge for the scrollbar so content never
renders under the thumb. 0 when the scrollbar is hidden.
Returns
Section titled “Returns”number
scrollOffset
Section titled “scrollOffset”Get Signature
Section titled “Get Signature”get scrollOffset():
number
Defined in: ui/src/ScrollView.ts:191
Current scroll offset in pixels along the scroll axis.
Returns
Section titled “Returns”number
visible
Section titled “visible”Get Signature
Section titled “Get Signature”get visible():
boolean
Defined in: ui/src/ScrollView.ts:383
Returns
Section titled “Returns”boolean
Set Signature
Section titled “Set Signature”set visible(
v):void
Defined in: ui/src/ScrollView.ts:387
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”addElement()
Section titled “addElement()”addElement(
child):void
Defined in: ui/src/ScrollView.ts:176
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”applyLayout()
Section titled “applyLayout()”applyLayout():
void
Defined in: ui/src/ScrollView.ts:231
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”UIContainerElement.applyLayout
destroy()
Section titled “destroy()”destroy():
void
Defined in: ui/src/ScrollView.ts:443
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”insertElementBefore()
Section titled “insertElementBefore()”insertElementBefore(
child,before):void
Defined in: ui/src/ScrollView.ts:184
Parameters
Section titled “Parameters”before
Section titled “before”Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”UIContainerElement.insertElementBefore
removeElement()
Section titled “removeElement()”removeElement(
child):void
Defined in: ui/src/ScrollView.ts:180
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”UIContainerElement.removeElement
scrollBy()
Section titled “scrollBy()”scrollBy(
delta):void
Defined in: ui/src/ScrollView.ts:225
Scroll by a relative delta (clamped). Positive = toward content end.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
scrollTo()
Section titled “scrollTo()”scrollTo(
offset):void
Defined in: ui/src/ScrollView.ts:220
Scroll to an absolute offset (clamped).
Parameters
Section titled “Parameters”offset
Section titled “offset”number
Returns
Section titled “Returns”void
update()
Section titled “update()”update(
props):void
Defined in: ui/src/ScrollView.ts:392
Parameters
Section titled “Parameters”Partial<ScrollViewProps>
Returns
Section titled “Returns”void