Cheeso135
|
  |
| Joined: 13 Apr 2013 |
| Total Posts: 2016 |
|
|
| 07 Nov 2014 03:22 PM |
| Also in games? It is to center Guis in the middle of the screen....? |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 07 Nov 2014 03:25 PM |
If you need to centre GUIs, then it's advised to position it at 0.5, -AbsoluteSize.X/2,0.5,-AbsoluteSize.Y/2
I'm probably wrong about the AbsoluteSize thing (Probably under a different name), but that's how it's done. |
|
|
| Report Abuse |
|
|
Cheeso135
|
  |
| Joined: 13 Apr 2013 |
| Total Posts: 2016 |
|
|
| 07 Nov 2014 03:28 PM |
| So this would center a gui? {0.5, 0},{0.5, 0} |
|
|
| Report Abuse |
|
|
|
| 07 Nov 2014 03:29 PM |
| No, that would center the top-left corner of the GUI. |
|
|
| Report Abuse |
|
|
| |
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 07 Nov 2014 03:42 PM |
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
Related http://www.roblox.com/Forum/ShowPost.aspx?PostID=142192913 |
|
|
| Report Abuse |
|
|
Cheeso135
|
  |
| Joined: 13 Apr 2013 |
| Total Posts: 2016 |
|
|
| 07 Nov 2014 03:48 PM |
| So basically it can just be .25? |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 07 Nov 2014 03:51 PM |
| No it depends on the size of your screen |
|
|
| Report Abuse |
|
|
Cheeso135
|
  |
| Joined: 13 Apr 2013 |
| Total Posts: 2016 |
|
|
| 07 Nov 2014 03:56 PM |
| Oh.....So basically just keep testing right? |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 07 Nov 2014 03:57 PM |
No. He told you exactly what to do stop being stupid. |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 07 Nov 2014 03:58 PM |
| No I gave you the equation for finding the center based on gui size |
|
|
| Report Abuse |
|
|