A fixed-size, vertically scrollable container. Add children to content; call refreshContent() after (re)filling it. Scrolls by mouse wheel and by dragging the slim scrollbar thumb. Clipping uses scrollRect (GPU clip — scrolling never repaints children).

Constructor

new(width:Float, height:Float)

Parameters:

width

layout width (the scrollbar lives inside it)

height

the visible viewport height

Variables

finalcontent:Sprite

Put pane content here (coordinates relative to the pane's top-left).

read onlymaxScroll:Float

The furthest scrollY can go.

@:value(0)read onlyscrollY:Float = 0

Current scroll offset in pixels (0..maxScroll).

@:value(40)wheelStep:Float = 40

Pixels per wheel notch.

Methods

refreshContent(?explicitHeight:Float):Void

Re-measures the content height and clamps the scroll position. Call after (re)filling content.

Parameters:

explicitHeight

overrides the measured content.height when provided

setScroll(value:Float):Void

Scrolls to an absolute offset.

Parameters:

value

the target offset in pixels (clamped to 0..maxScroll)

Inherited Variables

Defined by UIComponent

@:value(true)enabled:Bool = true

Disabled widgets ignore the pointer and typically render dimmed.

@:value(0)read onlyh:Float = 0

Layout height in UI units.

@:value(MouseCursor.BUTTON)hoverCursor:MouseCursor = MouseCursor.BUTTON

Native cursor while hovering (interactive widgets; null keeps the arrow).

@:value(false)read onlyhovered:Bool = false

true while the cursor is over this widget.

@:value(null)onClick:() ‑> Void = null

Fired on a completed click (press + release on this widget).

@:value(null)onHover:() ‑> Void = null

Fired when the cursor first enters this widget (hover-driven descriptions/previews).

@:value(null)onRightClick:() ‑> Void = null

Fired on a right mouse press over this widget (context menus).

@:value(false)read onlypressed:Bool = false

true while a press that started here is held.

@:value(null)tooltip:String = null

Optional tooltip text (already-localized or a fixed string).

@:value(null)tooltipShortcut:String = null

Optional right-aligned shortcut hint rendered in the tooltip.

@:value(0)read onlyw:Float = 0

Layout width in UI units (independent of DisplayObject's content-derived width).

Inherited Methods

Defined by UIComponent

invalidate():Void

Schedules a repaint for the next frame (cheap; deduplicated).

resize(width:Float, height:Float):Void

Sets the layout size and repaints when it changed.

Parameters:

width

the new layout width in UI units

height

the new layout height in UI units