Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you value AspectRatio?

Asked by 6 years ago
Edited 6 years ago

So I am trying to use AspectRatio on my GUI but it says the value is a float and I can't find any articles on the wiki other then the directed link to numbers which doesn't specify it...

--Variables
local StarterGui = script.Parent
local UI = Instance.new('UIAspectRatioConstraint')
local image = Instance.new('ImageLabel')

--Parents
image.Parent = screenGui
UI.Parent = image

--???
UI.AspectRatio = ?

for more understanding I'm trying to find out what a float is if anyone could help.

Edit: When I use Vector2 and a Integer that's positive it errors and says I need a positive value :/

thx, RoButCantBlox

1 answer

Log in to vote
0
Answered by 6 years ago

A float is simply a positive number with or without decimals.

UI.AspectRatio = 2 -- This should make your GUI twice as wide as a square.

If this helped, upvote/accept it! Thanks!

0
thx, I'm surprised i didn't think of that... i thought it would be a X to Y ratio that's why i used Vector2 :) RoButCantBlox 68 — 6y
Ad

Answer this question