|
| 24 Aug 2013 12:08 PM |
| I'm going to be making alot of GUI objects for a game and I would like to know how people like crazyman32 make GUIs to where no matter what comp you are on the labels, size of text, and positioning all is to scale and doesn't change? |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2013 12:10 PM |
| I would greatly appreciate an answer that finally puts this to rest for me :/ |
|
|
| Report Abuse |
|
|
shooter06
|
  |
| Joined: 13 Jan 2011 |
| Total Posts: 7443 |
|
| |
|
seth101
|
  |
| Joined: 06 Nov 2007 |
| Total Posts: 554 |
|
|
| 24 Aug 2013 12:19 PM |
| Maybe there's some function that retrieves the screen size, than you can set the GUIs relative to that.. "idk..." |
|
|
| Report Abuse |
|
|
pugzy
|
  |
| Joined: 16 Aug 2007 |
| Total Posts: 11957 |
|
| |
|
|
| 24 Aug 2013 12:43 PM |
Use scale.
Gui.Size/Position = UDim2.new(XScale, XOffset, YScale, Yoffset)
Where UDim2.new(0.5, 0, 0.5, 0) places the Gui's top left corner half way on the x axis and half way on the y axis(in the middle of the screen). |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2013 12:53 PM |
| Why would I ever use offset then? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 24 Aug 2013 12:54 PM |
Sizes, don't use scale for offset or you will see a big problem.
Use Scale for positioning the GUI frames Use offset for everything else |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2013 12:57 PM |
| But if I use scale for positioning it won't fit the same on everyones screen? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 24 Aug 2013 12:58 PM |
It will, it's the absolute size, but for positioning you want to use scale.
Look at it in my game if you want (gas. sim. 2( |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2013 01:06 PM |
Thanks, I think that should work
Also if you don't mind, how do you make frames draggable, is there a boolvalue or something? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 24 Aug 2013 01:08 PM |
Select the frame Check Active Check Draggable
Tada, it's that simple |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2013 01:10 PM |
| I knew it had to be simple, now I can start building my guis correctly, thanks ;) |
|
|
| Report Abuse |
|
|