类参考
UDreamLayoutContainerWidgetSwitcher
UMG Widget Switcher
本页由 DreamGUIReferenceDocs commandlet 从反射生成,正文是头文件注释的原文(英文),所以不翻译——这样它永远和代码一致。概念讲解见核心概念。
Inherits from UDreamPanelLayoutBase.
Declared in Public/Core/Components/DreamPanelLayouts.h.
UMG Widget Switcher
Properties
| Name | Type | Category | In the details panel | From Blueprint | Description |
|---|---|---|---|---|---|
ActiveWidgetIndex | int32 | WidgetSwitcher | yes | SetActiveWidgetIndex | |
Padding | FMargin | WidgetSwitcher | yes | SetPadding |
Functions
| Function | Kind | Description |
|---|---|---|
UDreamWidget* GetActiveWidget() | pure | Get Active Widget |
int32 GetActiveWidgetIndex() | pure | Get Active Widget Index |
int32 GetNumWidgets() | pure | How 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) | pure | Get Widget at Index |
bool SetActiveWidget(UDreamWidget* Value) | callable | UMG's UWidgetSwitcher::SetActiveWidget: show a page by identity rather than by position. |
void SetActiveWidgetIndex(int32 Value) | callable | Set Active Widget Index |
void SetPadding(FMargin Value) | callable | Set 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.
| UMG | Member | Status | Here | Note |
|---|---|---|---|---|
UWidgetSwitcher | ActiveWidgetIndex | adopt | ActiveWidgetIndex | The single source of truth: GetActiveWidget resolves through it, and SetActiveWidget is a lookup followed by writing it. |
UWidgetSwitcher | GetNumWidgets | adopt | GetNumWidgets | Answers what GetChildrenCount answers; a switcher's pages are its children. |
UWidgetSwitcher | GetActiveWidgetIndex | adopt | GetActiveWidgetIndex | |
UWidgetSwitcher | SetActiveWidgetIndex | adopt | SetActiveWidgetIndex | |
UWidgetSwitcher | SetActiveWidget | adopt | SetActiveWidget | Returns whether the widget was found; anything that is not a child is ignored rather than silently switching to page 0. |
UWidgetSwitcher | GetWidgetAtIndex | adopt | GetWidgetAtIndex | |
UWidgetSwitcher | GetActiveWidget | adopt | GetActiveWidget |