UI Scale
*此内容使用人工智能(Beta)翻译,可能包含错误。若要查看英文页面,请点按 此处。
代码示例
用户界面缩放演示
-- 将图像排列在列表中
Instance.new("UIListLayout", script.Parent).SortOrder = Enum.SortOrder.LayoutOrder
-- 使用 UIScale 对象创建一些不同大小的图像
for size = 0.2, 1.5, 0.2 do
local image = Instance.new("ImageLabel")
image.Image = "rbxassetid://284402752" -- 一张锁的图像
image.Parent = script.Parent
image.Size = UDim2.fromOffset(100, 100)
-- 通过添加一个 UIScale 来缩放图像,使用该大小
-- 注意:这是一个简写,因为我们不需要 UIScale 的引用
Instance.new("UIScale", image).Scale = size
endAPI 参考
属性
Scale
代码示例
用户界面缩放演示
-- 将图像排列在列表中
Instance.new("UIListLayout", script.Parent).SortOrder = Enum.SortOrder.LayoutOrder
-- 使用 UIScale 对象创建一些不同大小的图像
for size = 0.2, 1.5, 0.2 do
local image = Instance.new("ImageLabel")
image.Image = "rbxassetid://284402752" -- 一张锁的图像
image.Parent = script.Parent
image.Size = UDim2.fromOffset(100, 100)
-- 通过添加一个 UIScale 来缩放图像,使用该大小
-- 注意:这是一个简写,因为我们不需要 UIScale 的引用
Instance.new("UIScale", image).Scale = size
end