ScrollingFrame

显示已弃用

*此内容使用人工智能(Beta)翻译,可能包含错误。若要查看英文页面,请点按 此处

ScrollingFrame 是带有内置滚动交互性和不同方法来自定义滚动工作方式的特殊 Frame 类型。

Example ScrollingFrame on the screen containing a tabbed category bar and a list of magical items for the player to consider purchasing.

概要

属性

继承自GuiObject属性继承自GuiBase2d属性

方法

继承自GuiObject方法

活动

继承自GuiObject活动继承自GuiBase2d活动

属性

AbsoluteCanvasSize

只读
未复制

可滚动的区域的大小,以偏移为单位。该属性设置为 CanvasSize 属性的最大值和子供的尺寸,如果 AutomaticCanvasSize 设置为与 Enum.AutomaticSize.None 不同的东西。

AbsoluteWindowSize

只读
未复制

框架的大小,在抵消中,没有滚动条。

AutomaticCanvasSize

读取并联

该属性用于自动根据其子对象的大小调整父级 UI 对象的大小。您可以使用此属性来在编辑或运行时动态添加文本和其他内容到 ScrollingFrame 并且尺寸会调整以适应该内容。

当此属性设置为 Enum.AutomaticSize 值与 None 不同时,AbsoluteCanvasSize 可以根据其子内容进行调整。

BottomImage

ContentId
读取并联

显示在垂直滚动栏底部或横向滚动栏右侧的图像(对于横向滚动栏,旋转 90° 逆时针)。

Diagram showing the three image asset elements which construct a scrolling frame's scroll bar.

CanvasPosition

读取并联

反映框内画布的 当前 位置偏移,以像素计,并根据滚动条的位置设置相应的位置。请注意,如果滚动栏不可见,该属性将无任何作用。

CanvasSize

读取并联

确定可滚动区域的大小。对于基于 ScrollingFrame 内孩子总体尺寸的适应性替代方案,请考虑使用 AutomaticCanvasSize

ElasticBehavior

读取并联

该属性决定是否允许触摸启用的设备上使用弹性滚动。默认为 WhenScrollable

HorizontalScrollBarInset

读取并联

指示 whether CanvasSize 是否被 ScrollBarThickness 在垂直轴上插入。

MidImage

ContentId
读取并联

TopImageBottomImage 之间的图像(旋转了 90° 逆时针滚动条)。该图像会自动扩展以填充帽子段之间的空间。

Diagram showing the three image asset elements which construct a scrolling frame's scroll bar.

ScrollBarImageColor3

读取并联

决定滚动栏图像(TopImageMidImageBottomImage)的颜色化方式。当设置为白色时,不会发生颜色化。该属性对于重复使用图像资产有用;如果源图像完全透明且完全白色,您可以一次设置整个滚动条的颜色。

ScrollBarImageTransparency

读取并联

决定滚动栏图像的不透明度(TopImageMidImageBottomImage)。一个值 0 是完全不透明的,另一个值 1 是完全透明的(隐形)。

ScrollBarThickness

读取并联

以像素计算滚动条的厚度;适用于横向和纵向滚动条。如果设置为 0 ,则无滚动条被渲染。

ScrollingDirection

读取并联

该属性决定允许滚动的方向(s)。如果在一个方向上禁用滚动,相关的滚动栏不会出现。默认为 Enum.ScrollingDirection.XY .

ScrollingEnabled

读取并联

决定框上是否允许滚动。如果 false ,将不会渲染滚动栏。

TopImage

ContentId
读取并联

显示在垂直滚动栏顶部或横向滚动栏左侧的图像(旋转 90° 逆时针为横向滚动栏)。

Diagram showing the three image asset elements which construct a scrolling frame's scroll bar.

VerticalScrollBarInset

读取并联

指示 whether CanvasSize 是否被垂直轴上的 ScrollBarThickness 插入。

VerticalScrollBarPosition

读取并联

指示垂直滚动栏是否位于画布左侧或右侧。默认为 Enum.VerticalScrollBarPosition.Right

方法

活动