| |
|
adeep
|
  |
| Joined: 06 Feb 2010 |
| Total Posts: 274 |
|
|
| 08 Oct 2014 11:11 PM |
x scale = 0.5 y scale = 0.5 |
|
|
| Report Abuse |
|
|
|
| 08 Oct 2014 11:12 PM |
adeep isn't being specific enough
size the GUI using offset, put 0.5 on both the x scale and y scale, and subtract divide the gui's AbsoluteSize.X by 2, and put the negative result in the x offset for position. then do the same for y |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 08 Oct 2014 11:14 PM |
Good way to do this:
Get all of the side bars out of the way.. Search Free Models, Objects, Properties, and Explorer.. They offset the gui on your screen. Get those out of the way and it'll be much easier.. at lease for the x axis due to the y axis still being obscured by the top studio bar. |
|
|
| Report Abuse |
|
|
|
| 08 Oct 2014 11:24 PM |
frame = game.StarterGui.ScreenGui.Frame
frame.Position = UDim2.new(.5,-frame,Size.X/2,.5,-frame,Size.Y/2)
paste this with the correct location to the gui you want to center into the cmd bar |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 09 Oct 2014 12:56 AM |
local size = yourGui.Size local center = UDim2.new((0.5 - (size.X.Scale / 2)), -(size.X.Offset / 2), (0.5 - (size.Y.Scale / 2)), -(size.Y.Offset / 2)) yourGui.Position = center |
|
|
| Report Abuse |
|
|
powertool
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 3771 |
|
|
| 09 Oct 2014 12:58 AM |
The exact middle for any ScreenGui is as follows:
path.to.gui.Size=UDim2.new(0,sizeX,0,sizeY) path.to.gui.Position=UDim2.new(0.5,-(sizeX/2),0.5,-(sizeY/2)) |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 09 Oct 2014 01:04 AM |
@Power No its not, not if the gui uses scale for size |
|
|
| Report Abuse |
|
|
powertool
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 3771 |
|
|
| 09 Oct 2014 01:11 AM |
| It doesn't use scale for its size. That's very bad practice for anything that isn't trying to determine the screen size of the player. |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 09 Oct 2014 01:14 AM |
You don't know if OP is using scale for their gui
If you don't use scale, people with smaller screens (Particularly mobile devices, but also maybe just a small laptop) will have guis completely covering the screen |
|
|
| Report Abuse |
|
|
powertool
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 3771 |
|
|
| 09 Oct 2014 01:29 AM |
Hence why I design my GUIs to be positioned according to scale, but sized with offsets.
Hence why I design my GUIs on a 13" laptop (not a large one by any standards), hence why I design a separate mobile version. |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 09 Oct 2014 01:58 AM |
| ... Hence why it's not unreasonable practice to combine scale with offset in the size... |
|
|
| Report Abuse |
|
|