generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: How do you get a gui directly centered?

Previous Thread :: Next Thread 
Despawned is not online. Despawned
Joined: 06 Apr 2013
Total Posts: 12569
26 Nov 2015 07:28 PM
Isn't is "0.5" on the first data section, then minus half of the frame's length?

Like my frame is {0, 100},{0, 50} in size, so the position would be this?

{0.5, -50},{0, 0}

Pls help
Report Abuse
morashsPeasant is not online. morashsPeasant
Joined: 06 Jan 2011
Total Posts: 4944
26 Nov 2015 07:39 PM
{0.5, -50},{0.5, -25}
You need to get it centered on the Y axis as well.
Report Abuse
Despawned is not online. Despawned
Joined: 06 Apr 2013
Total Posts: 12569
27 Nov 2015 12:21 PM
@mor nah. I just wanted it on the top of the screen.
Report Abuse
SaluteMeScrub is not online. SaluteMeScrub
Joined: 28 Dec 2013
Total Posts: 380
27 Nov 2015 12:23 PM
What is currently wrong with {0.5,-50},{0,0}
Report Abuse
brados123 is not online. brados123
Joined: 24 Nov 2012
Total Posts: 2143
27 Nov 2015 12:25 PM
just do size:

0,500,0,55

position

0.5, -250, 0.5, -250.
Report Abuse
SaluteMeScrub is not online. SaluteMeScrub
Joined: 28 Dec 2013
Total Posts: 380
27 Nov 2015 12:26 PM
What would this do exactly? Besides likes the GUI bigger than he wants.
Report Abuse
brados123 is not online. brados123
Joined: 24 Nov 2012
Total Posts: 2143
27 Nov 2015 05:11 PM
it centeres the gui, at a nice size too.
Report Abuse
OKevinO is not online. OKevinO
Joined: 05 May 2010
Total Posts: 1036
27 Nov 2015 05:35 PM
#Brados

Yes it does indeed, but using that would just change the pixel size, which means no matter how big or small your screen resolution is, or your window size, the GUI will stay the same size it looks like in studio, because it is in pixels.

The other one however, would scale it down depending on the size of your resolution and window size, making it fit your screen no matter the size, which also allows it to center it at the perfect position.

This goes the same for position, if you're 400 pixels out, but your screen is only 350 pixels (example of course), then 50 pixels of that frame will be cut off.

using {0.5, -50} should work fine, if you resized your frame with the other value, then you could center it better without subtracting 50.
Report Abuse
Strycerxxx is not online. Strycerxxx
Joined: 09 Feb 2010
Total Posts: 1745
27 Nov 2015 05:47 PM
This method will work for any GUI's no matter the size



1)What you need to do is find the size of you're GUI
ex:
{.6, 0},{.6, 0}

2) Then divide the size by 2
ex:
.6/2 =.3

3) Now subtract .5 by this amount
ex:
.5-.3=.2

4) Use that value for you're position

NOTE: the X value and the Y must be calculated separately if they aren't different in size

For this example the final position would be {.2, 0},{.2, 0}

Report Abuse
Strycerxxx is not online. Strycerxxx
Joined: 09 Feb 2010
Total Posts: 1745
27 Nov 2015 05:49 PM
EDIT: NOTE: if the X and Y values a different they must be separately calculated.
Report Abuse
62GB is not online. 62GB
Joined: 03 Oct 2011
Total Posts: 4157
27 Nov 2015 06:05 PM
Let me try to get you a method for this, use scale! So uh, '1' would bring the GUI element up to the top, so subtract the GUI's Y size from 1 and maybe you'll end up centered. If that's right.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image