Skip to content

UIImage

继承自

描述

2d界面图片节点

属性

stringIcon
图片资源路径
FillMethodFillMethod
填充模式
FillOriginFillOrigin
填充原点(仅在Horizontal与Vertical填充模式下适用)
boolFillClockwise
顺时针填充(仅在Radial360模式下适用),为true时以上方中点为起点,根据FillAmount比例顺时针渲染,否则为逆时针
floatFillAmount
填充比例(0~1),填充显示的部分占原来大小的比例
boolIsAutoSize
自动大小。为true时,将节点大小调整为图片原本大小
floatAlpha
为1时不透明
Vector2ResourceSize
资源大小
ScaleTypeScaleType
比例类型
Vector4Scale9Grid
图片比例九宫格
boolAutoTranslator
是否开启自动翻译
boolBlurFilter
是否开启高斯模糊
intBlurSigma
高斯模糊sigma(取值范围1-5)
boolUIMaskMode

代码示例

lua
local workspace = game:GetService("WorkSpace")
local name = SandboxNode.new('UIList', workspace)

--设置排列方式
name.ScrollType = Enum.ListLayoutType.FLOW_HORIZONTAL
name.OverflowType = Enum.OverflowType.HORIZONTAL
--设置行数列数
name.LineCount = 2
name.ColumnCount = 2

--设置行距列距
name.LineGap= 50
name.ColumnGap= 50

--设置自动调整项目大小
name.AutoResizeItem= true

--设置上下居中对齐
name.HorizontalAlign= Enum.TextVAlignment.Center
--设置左右向左对齐
name.VerticalAlign= Enum.TextHAlignment.Left

--设置虚拟循环列表
name.SetVirtualAndLoop