DreamGUI
类参考

UDreamLayoutContainerScaleBox

UDreamLayoutContainerScaleBox

继承自 UDreamPanelLayoutBase。

声明于 Public/Core/Components/DreamPanelLayouts.h。

UMG Scale Box

Properties

NameTypeCategoryIn the details panelFrom BlueprintDescription
PaddingFMarginScaleBoxyesSetPadding
StretchEDreamScaleBoxStretchScaleBoxyesSetStretch内容如何缩放。ScaleToFitX、ScaleToFitY、ScaleToFill 和 UserSpecifiedWithClipping 会将内容裁剪到框内,同时控件自身的 Clipping 保持为 Inherit,这与 SScaleBox 的绘制行为一致。
UserSpecifiedScalefloatScaleBoxyesSetUserSpecifiedScale
bIgnoreInheritedScaleboolScaleBoxyesSetIgnoreInheritedScale将拉伸模式得出的缩放值除以该框从上层继承的缩放值,使内容在屏幕上按该缩放绘制。所有模式都如此,正如 SScaleBox 对所有模式都进行此除法——并且测量方式与排布方式完全一致,因此该框向父级请求的是其内容实际占用的空间。
StretchDirectionEDreamScaleBoxStretchDirectionScaleBoxyesSetStretchDirection该框允许以哪种方向缩放,对应 Slate 的 EStretchDirection。实际使用的是 DownOnly:按预期尺寸制作的美术资源在小屏幕上应缩小以适应,而绝不应被放大超出该尺寸,这是 Stretch 模式自身无法表达的一项规则。

Functions

FunctionKindDescription
float GetSafeZoneScale()pureScaleBySafeZone 当前绘制的缩放值:在任何其他拉伸模式下为 1,在没有游戏视口可查询时也为 1。
void SetIgnoreInheritedScale(bool Value)callableSet Ignore Inherited Scale
void SetPadding(FMargin Value)callableSet Padding
void SetStretch(EDreamScaleBoxStretch Value)callableSet Stretch
void SetStretchDirection(EDreamScaleBoxStretchDirection Value)callableSet Stretch Direction
void SetUserSpecifiedScale(float Value)callableSet User Specified Scale

Compared with UMG

UMG 类中所有面向蓝图的成员,以及它们各自的去向。adopt:名称相同,含义相同。map:在此处以另一个名称或另一种类型存在。reject:有意缺失,并说明原因。

UMGMemberStatusHereNote
UScaleBoxStretchadoptStretchEDreamScaleBoxStretch,包含 Slate EStretch 的全部九种情况;ScaleBySafeZone 和 UserSpecifiedWithClipping 是最后追加的,因此在此之前保存的每个值都保持原有含义。ScaleBySafeZone 按从游戏视口安全边距取得的一个缩放值绘制(GetSafeZoneScale,在拉伸或平台安全框变化时刷新;没有游戏视口时为 1)。ScaleToFitX、ScaleToFitY、ScaleToFill 和 UserSpecifiedWithClipping 会将内容裁剪到框内,同时控件自身的 Clipping 为 Inherit,这与 SScaleBox 的绘制行为一致。
UScaleBoxStretchDirectionadoptStretchDirectionEDreamScaleBoxStretchDirection。仅约束模式得出的缩放值,且仅此而已:明确指定的缩放值(UserSpecified、UserSpecifiedWithClipping、ScaleBySafeZone)和 Fill 是直接声明缩放值而非推导得出,因此与 Slate 中一样不受约束。
UScaleBoxUserSpecifiedScaleadoptUserSpecifiedScale
UScaleBoxIgnoreInheritedScalemapbIgnoreInheritedScale名称相同,但采用本插件的布尔前缀。所有模式的缩放值都会除以继承的缩放值,正如 SScaleBox 对所有模式都进行此除法,并且测量方式与排布方式一致,因此该框向父级请求的是其内容占用的空间。
UScaleBoxSetStretchadoptSetStretch
UScaleBoxSetStretchDirectionadoptSetStretchDirection
UScaleBoxSetUserSpecifiedScaleadoptSetUserSpecifiedScale
UScaleBoxSetIgnoreInheritedScaleadoptSetIgnoreInheritedScale

本页目录