UIScale

사용되지 않는 항목 표시

*이 콘텐츠는 AI(베타)를 사용해 번역되었으며, 오류가 있을 수 있습니다. 이 페이지를 영어로 보려면 여기를 클릭하세요.

UIScale 개체는 단순히 부모 UI 요소의 GuiBase2d.AbsoluteSize를 곱하는 데 사용되는 숫자를 포함합니다. 이 숫자는 UIScale.Scale에 저장됩니다.

코드 샘플

UI Scale Demo

-- Lay out the images in a list
Instance.new("UIListLayout", script.Parent).SortOrder = Enum.SortOrder.LayoutOrder
-- Create some images of varying sizes using UIScale objects
for size = 0.2, 1.5, 0.2 do
local image = Instance.new("ImageLabel")
image.Image = "rbxassetid://284402752" -- an image of a Lock
image.Parent = script.Parent
image.Size = UDim2.new(0, 100, 0, 100)
-- Scale the image by adding a UIScale with the size
-- Note: this is a shorthand since we don't need a reference to the UIScale
Instance.new("UIScale", image).Scale = size
end

속성

Scale

병렬 읽기

규모 속성은 부모 UI 요소의 GuiBase2d.AbsoluteSize에 사용되는 배수를 결정합니다.0.5로 설정되면 0, 200, 0, 50의 절대 크기가 0, 100, 0, 25가 됩니다.마찬가지로, 2로 설정되면 이러한 절대 크기는 0, 400, 0, 100이 됩니다.

코드 샘플

UI Scale Demo

-- Lay out the images in a list
Instance.new("UIListLayout", script.Parent).SortOrder = Enum.SortOrder.LayoutOrder
-- Create some images of varying sizes using UIScale objects
for size = 0.2, 1.5, 0.2 do
local image = Instance.new("ImageLabel")
image.Image = "rbxassetid://284402752" -- an image of a Lock
image.Parent = script.Parent
image.Size = UDim2.new(0, 100, 0, 100)
-- Scale the image by adding a UIScale with the size
-- Note: this is a shorthand since we don't need a reference to the UIScale
Instance.new("UIScale", image).Scale = size
end

메서드

이벤트