DreamGUI
类参考

UDreamLayoutContainerScrollBox

UMG Scroll Box

本页由 DreamGUIReferenceDocs commandlet 从反射生成,正文是头文件注释的原文(英文),所以不翻译——这样它永远和代码一致。概念讲解见核心概念。

Inherits from UDreamLayoutContainerStackBox.

Declared in Public/Core/Components/DreamPanelLayouts.h.

UMG Scroll Box

Properties

NameTypeCategoryIn the details panelFrom BlueprintDescription
ScrollSensitivityfloatScrollBoxyesGetScrollSensitivity / SetScrollSensitivityLocal units scrolled per wheel notch.
ConsumeMouseWheelEDreamScrollBoxConsumeMouseWheelScrollBoxyesGetConsumeMouseWheel / SetConsumeMouseWheelWhether the wheel is swallowed here or handed to an outer scroll box once this one is at a limit.
WheelScrollMultiplierfloatScrollBoxyesGetWheelScrollMultiplier / SetWheelScrollMultiplierA plain multiplier on whatever one wheel notch already travels -- UMG's WheelScrollMultiplier. ScrollSensitivity is the distance; this scales it, so "the same feel, twice as fast" is one number and not a re-tuned one.
NavigationDestinationEDreamUIScrollDestinationScrollBoxyesGetNavigationDestination / SetNavigationDestinationWhere a widget revealed by ScrollWidgetIntoView ends up -- UMG's NavigationDestination.
NavigationScrollPaddingfloatScrollBoxyesGetNavigationScrollPadding / SetNavigationScrollPaddingHow much of the window to keep clear around a revealed widget, in local units -- UMG's NavigationScrollPadding. Stops a row landing flush against the edge with its neighbour cut in half beside it, which is the only cue a player has that the list continues.
ScrollWhenFocusChangesEDreamUIScrollWhenFocusChangesScrollBoxyesGetScrollWhenFocusChanges / SetScrollWhenFocusChangesWhat this box does when user focus lands inside it -- UMG's ScrollWhenFocusChanges. Read by FDreamUINavigationScroll, which is the only thing that reveals a widget because focus moved.
AnalogMouseWheelKeyFKeyScrollBoxyesGetAnalogMouseWheelKey / SetAnalogMouseWheelKeyThe analog key that acts as this box's mouse wheel -- UMG's AnalogMouseWheelKey. Invalid (the default) means "whatever the input preset already routes here", which is the right stick and therefore exactly today's behaviour.
ScrollbarTWeakObjectPtr<UDreamUIBehaviour>ScrollBoxyesread / writeA scrollbar behaviour to keep in step with this box, both ways -- a UUIScrollbar, or anything else that implements IDreamUIScrollbarInterface. Assign the component from a scrollbar prefab (/DreamGUI/Prefabs/VerticalScrollbar or HorizontalScrollbar) placed anywhere in the hierarchy -- it does not have to be a child of this box. Which end of the bar means zero is the BAR's business: this box always feeds the raw 0..1 fraction and the bar's own DirectionType decides the mapping.
ScrollbarVisibilityEDreamScrollBoxScrollbarVisibilityScrollBoxyesGetScrollbarVisibility / SetScrollbarVisibilityWhether that bar hides itself when the content already fits.
bAnimateWheelScrollingboolScrollBoxyesGetAnimateWheelScrolling / SetAnimateWheelScrollingEase to the wheel's new position over a few frames instead of jumping there.
ScrollAnimationModeEDreamScrollAnimationModeScrollBoxyesGetScrollAnimationMode / SetScrollAnimationModeWhich curve an eased scroll follows.
ScrollAnimationInterpolationSpeedfloatScrollBoxyesGetScrollAnimationInterpolationSpeed / SetScrollAnimationInterpolationSpeedFInterpTo speed, used by InterpToSpeed only. Larger arrives sooner; UMG's default is 15.
ScrollAnimationEaseEDreamTweenEaseScrollBoxyesGetScrollAnimationEase / SetScrollAnimationEaseCurve shape, used by EaseCurve only. Any of DreamTween's easings, overshooting ones included.
ScrollAnimationDurationfloatScrollBoxyesGetScrollAnimationDuration / SetScrollAnimationDurationSeconds an eased scroll takes, used by EaseCurve only.
bEnableInertiaboolScrollBoxyesGetEnableInertia / SetEnableInertiaKeep moving under momentum after the finger or mouse lets go.
DecelerationRatefloatScrollBoxyesGetDecelerationRate / SetDecelerationRateHow quickly momentum dies. 0 never slows down; larger values stop sooner. Same units and default as the legacy scroll view, so a value tuned there carries over.
bAllowOverscrollboolScrollBoxyesGetAllowOverscroll / SetAllowOverscrollLet the content rubber-band past an end while dragging, then spring back on release.
OverscrollLimitfloatScrollBoxyesGetOverscrollLimit / SetOverscrollLimitHow far past an end the content can be pulled, in local units. The pull saturates towards this rather than stopping at it, so the resistance grows the further out you drag and the content can never be dragged away indefinitely -- which the legacy view's flat damping allowed.
bBackPadScrollingboolScrollBoxyesGetBackPadScrolling / SetBackPadScrollingA whole viewport of empty space BEFORE the content -- UMG's BackPadScrolling: at offset zero the first child sits one viewport in, so the first item can be scrolled all the way to the far edge. A viewport rather than half of one, which is Slate's arithmetic (SScrollPanel's ScrollPadding is the panel's own length). It adds to the scroll range and takes nothing from what a Fill slot is given.
bFrontPadScrollingboolScrollBoxyesGetFrontPadScrolling / SetFrontPadScrollingA whole viewport of empty space AFTER the content -- UMG's FrontPadScrolling, so the last item can reach the near edge.
bAllowRightClickDragScrollingboolScrollBoxyesGetAllowRightClickDragScrolling / SetAllowRightClickDragScrollingWhether a drag with the RIGHT button scrolls this box -- UMG's bAllowRightClickDragScrolling, on by default as there. Off leaves the right button to whatever wants it for a context menu. On, a right drag is still refused while there is nothing to scroll, as SScrollBox refuses it unless its bar IsNeeded. A left-button drag scrolls whatever this says: it is this library's own gesture, and existing screens rely on it.
bEnableTouchScrollingboolScrollBoxyesGetEnableTouchScrolling / SetEnableTouchScrollingWhether a finger dragging over the box scrolls it -- UMG's bEnableTouchScrolling, on by default as there.
ScrollOffsetfloatScrollBoxyes-Distance scrolled from the start. Editable so the designer can scroll the content in the prefab editor (where no pointer input exists) to reach and edit off-screen children; the authored value is also the initial scroll position at runtime. Clamped to [0, GetMaxScrollOffset()] by layout.

Functions

FunctionKindDescription
bool CanScrollWidgetIntoView(UDreamWidget* InWidget)callableTrue when InWidget lives in this box and a scroll would bring more of it into sight. The question directional navigation has to answer before it commits to a candidate it cannot currently see.
void EndInertialScrolling()callableDrop the fling, keeping the position and whatever rubber band is open -- UMG's name for it.
bool GetAllowOverscroll()pureGet Allow Overscroll
bool GetAllowRightClickDragScrolling()pureGet Allow Right Click Drag Scrolling
FKey GetAnalogMouseWheelKey()pureGet Analog Mouse Wheel Key
float GetAnimatedScrollTarget()pureWhere an eased scroll is heading; the current offset when nothing is animating.
bool GetAnimateWheelScrolling()pureGet Animate Wheel Scrolling
bool GetBackPadScrolling()pureGet Back Pad Scrolling
EDreamScrollBoxConsumeMouseWheel GetConsumeMouseWheel()pureGet Consume Mouse Wheel
float GetDecelerationRate()pureGet Deceleration Rate
bool GetEnableInertia()pureGet Enable Inertia
bool GetEnableTouchScrolling()pureGet Enable Touch Scrolling
bool GetFrontPadScrolling()pureGet Front Pad Scrolling
float GetMaxScrollOffset()pureHow far this box can scroll: content extent minus viewport extent, or 0 when everything fits.
EDreamUIScrollDestination GetNavigationDestination()pureGet Navigation Destination
float GetNavigationScrollPadding()pureGet Navigation Scroll Padding
float GetOverscroll()pureSigned displacement past an end, damped; zero while in range. Layout adds it to the offset.
float GetOverscrollLimit()pureGet Overscroll Limit
float GetOverscrollPercentage()pureThe same displacement as a PERCENTAGE of the window -- UMG's GetOverscrollPercentage.
float GetScrollAnimationDuration()pureGet Scroll Animation Duration
EDreamTweenEase GetScrollAnimationEase()pureGet Scroll Animation Ease
float GetScrollAnimationInterpolationSpeed()pureGet Scroll Animation Interpolation Speed
EDreamScrollAnimationMode GetScrollAnimationMode()pureGet Scroll Animation Mode
UDreamUIBehaviour* GetScrollbar()pureThe bar this box drives. Takes the raw pointer, because the stored form is a weak one.
EDreamScrollBoxScrollbarVisibility GetScrollbarVisibility()pureGet Scrollbar Visibility
float GetScrollOffset()pureDistance scrolled from the start, in local units. Always within [0, GetMaxScrollOffset()].
float GetScrollOffsetOfEnd()pureThe offset at which the end of the content is in view -- UMG's name for GetMaxScrollOffset.
float GetScrollSensitivity()pureThe plain readers and writers for every knob above.
float GetScrollVelocity()pureGet Scroll Velocity
EDreamUIScrollWhenFocusChanges GetScrollWhenFocusChanges()pureGet Scroll when Focus Changes
float GetViewFraction()pureFraction of the content currently visible, 0..1. 1 when everything fits.
float GetViewOffsetFraction()pureHow far through the scrollable range the view sits, 0..1. 0 when nothing can scroll.
float GetWheelScrollMultiplier()pureGet Wheel Scroll Multiplier
bool IsAnimatingScroll()pureTrue while an eased scroll is still running.
bool IsScrollGestureMirrored()pureTrue when a GESTURE on this box has to be read backwards -- a horizontal box in a right-to-left layout, and nothing else.
bool IsScrolling()pureTrue while momentum or a spring-back is still moving the content.
bool IsScrollNeeded()pureWhether there is anything to scroll: content longer than the viewport, as the last layout pass measured it -- SScrollBar's IsNeeded. False before the first pass, which has measured nothing yet.
bool ScrollBy(float Delta)callableScroll by a signed delta. Returns true when the offset actually changed, false when already at a limit.
void ScrollToEnd()callableJump to the end of the content.
void ScrollToStart()callableJump to the start of the content.
bool ScrollWidgetIntoView(UDreamWidget* InWidget, bool bAnimateScroll, EDreamUIScrollDestination InDestination, float InPadding)callableScroll the minimum distance that brings InWidget into view. Accepts any descendant, not just a direct child. Returns false when the widget is not inside this box or nothing needed to move. Eased by default, as UMG's is -- a jump loses the reader's place on a long list.
void SetAllowOverscroll(bool Value)callableSet Allow Overscroll
void SetAllowRightClickDragScrolling(bool Value)callableRead when a drag begins, so a gesture already under way keeps the answer it started with.
void SetAnalogMouseWheelKey(FKey Value)callableSet Analog Mouse Wheel Key
void SetAnimateWheelScrolling(bool Value)callableSet Animate Wheel Scrolling
void SetBackPadScrolling(bool Value)callableMoves where offset zero puts the content and lengthens the range, so the box is re-arranged.
void SetConsumeMouseWheel(EDreamScrollBoxConsumeMouseWheel Value)callableSet Consume Mouse Wheel
void SetDecelerationRate(float Value)callableSet Deceleration Rate
void SetEnableInertia(bool Value)callableSet Enable Inertia
void SetEnableTouchScrolling(bool Value)callableSet Enable Touch Scrolling
void SetFrontPadScrolling(bool Value)callableSet Front Pad Scrolling
void SetNavigationDestination(EDreamUIScrollDestination Value)callableSet Navigation Destination
void SetNavigationScrollPadding(float Value)callableSet Navigation Scroll Padding
void SetOverscrollLimit(float Value)callableSet Overscroll Limit
void SetScrollAnimationDuration(float Value)callableSet Scroll Animation Duration
void SetScrollAnimationEase(EDreamTweenEase Value)callableSet Scroll Animation Ease
void SetScrollAnimationInterpolationSpeed(float Value)callableSet Scroll Animation Interpolation Speed
void SetScrollAnimationMode(EDreamScrollAnimationMode Value)callableSet Scroll Animation Mode
void SetScrollbar(UDreamUIBehaviour* Value)callableLink a scrollbar behaviour; one that does not implement IDreamUIScrollbarInterface is refused.
void SetScrollbarVisibility(EDreamScrollBoxScrollbarVisibility Value)callableSet Scrollbar Visibility
void SetScrollOffset(float Value)callableSet Scroll Offset
void SetScrollOffsetAnimated(float Value)callableEase towards Value over the coming frames instead of moving now. Cancels any momentum.
void SetScrollSensitivity(float Value)callableSet Scroll Sensitivity
void SetScrollVelocity(float Value)callableSet Scroll Velocity
void SetScrollWhenFocusChanges(EDreamUIScrollWhenFocusChanges Value)callableSet Scroll when Focus Changes
void SetWheelScrollMultiplier(float Value)callableSet Wheel Scroll Multiplier
void StopScrolling()callableDrop momentum and any rubber-band displacement immediately.
void TickScrollPhysics(float DeltaTime)callableAdvance momentum and spring-back by DeltaTime. Deliberately free of input plumbing: the physics can then be stepped directly by a test, which is the only way any of this gets verified without a real pointer.

Events

EventSignatureDescription
OnUserScrolledvoid DreamScrollBoxUserScrolledEvent__DelegateSignature(float CurrentOffset)

本页目录