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

How to make the position of a gui exact for every computer screen size?

Asked by 10 years ago

Well i always see it in popular games like if you resize your window screen the gui stays in the same position of the screen, but for my game the gui doesnt stay put!!!! it's really important, and ive been needing to know for a long time.

0
set its position to {0.5,0},{0.5,0} BUT change the two zeroes to negative and half the size of them. NinjoOnline 1146 — 10y

2 answers

Log in to vote
1
Answered by
adark 5487 Badge of Merit Moderation Voter Community Moderator
10 years ago

You use the Scale portion of the UDim2 for the Position property.

For example, this Frame will always be 25 pixels off from the lower right-hand corner:

local Frame = Instance.new("Frame", ScreenGui)--You'll have to define ScreenGui to actually use this code.

Frame.Size = UDim2.new(0, 50, 0, 50)
Frame.Position = UDim2.new(1, -75, 1, -75)
Ad
Log in to vote
-2
Answered by
RedCombee 585 Moderation Voter
10 years ago

wiki.roblox.com/index.php/UDim2

Answer this question