DreamGUI
类参考

UDreamLayoutContainerWidgetSwitcher

UMG Widget Switcher

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

Inherits from UDreamPanelLayoutBase.

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

UMG Widget Switcher

Properties

NameTypeCategoryIn the details panelFrom BlueprintDescription
ActiveWidgetIndexint32WidgetSwitcheryesSetActiveWidgetIndex
PaddingFMarginWidgetSwitcheryesSetPadding

Functions

FunctionKindDescription
UDreamWidget* GetActiveWidget()pureGet Active Widget
int32 GetActiveWidgetIndex()pureGet Active Widget Index
int32 GetNumWidgets()pureHow many pages this switcher has. UMG names it for the panel rather than for the children because that is what a switcher's children are; it answers the same number GetChildrenCount does.
UDreamWidget* GetWidgetAtIndex(int32 InIndex)pureGet Widget at Index
bool SetActiveWidget(UDreamWidget* Value)callableUMG's UWidgetSwitcher::SetActiveWidget: show a page by identity rather than by position.
void SetActiveWidgetIndex(int32 Value)callableSet Active Widget Index
void SetPadding(FMargin Value)callableSet Padding

Compared with UMG

Every Blueprint-facing member of the UMG class, and where it went. adopt: same name, same meaning. map: here under another name or on another type. reject: deliberately absent, with the reason.

UMGMemberStatusHereNote
UWidgetSwitcherActiveWidgetIndexadoptActiveWidgetIndexThe single source of truth: GetActiveWidget resolves through it, and SetActiveWidget is a lookup followed by writing it.
UWidgetSwitcherGetNumWidgetsadoptGetNumWidgetsAnswers what GetChildrenCount answers; a switcher's pages are its children.
UWidgetSwitcherGetActiveWidgetIndexadoptGetActiveWidgetIndex
UWidgetSwitcherSetActiveWidgetIndexadoptSetActiveWidgetIndex
UWidgetSwitcherSetActiveWidgetadoptSetActiveWidgetReturns whether the widget was found; anything that is not a child is ignored rather than silently switching to page 0.
UWidgetSwitcherGetWidgetAtIndexadoptGetWidgetAtIndex
UWidgetSwitcherGetActiveWidgetadoptGetActiveWidget

本页目录