UIScale

Artık kullanılmayanları göster

*Bu içerik, yapay zekâ (beta) kullanılarak çevrildi ve hatalar içerebilir. Sayfayı İngilizce görüntülemek için buraya tıkla.

Bir UIScale nesnesi basitçe ebeveyn UI öğesinin GuiBase2d.AbsoluteSize katlanması için kullanılan bir sayı içerir. Bu sayı UIScale.Scale 'de saklanır.

Kod Örnekleri

This code sample creates some images of a lock and scales them using UIScale. It lays them out using a UIListLayout.

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

Özellikler

Scale

Paralel oku

Ölçek özelliği, ebeveyn UI öğesinin GuiBase2d.AbsoluteSize 'sinde kullanılan çarpanı belirler.0.5 olarak ayarlanırsa, 0, 200, 0, 50'lik mutlak bir boyut 0, 100, 0, 25 olur.Benzer şekilde, 2 olarak ayarlanınca, böyle bir Mutlak Boyut 0, 400, 0, 100 olurdu.

Kod Örnekleri

This code sample creates some images of a lock and scales them using UIScale. It lays them out using a UIListLayout.

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

Yöntemler

Etkinlikler