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 » Scripting Helpers
Home Search
 

Re: GUI centering??

Previous Thread :: Next Thread 
Drak0Master is not online. Drak0Master
Joined: 10 Aug 2009
Total Posts: 836
19 Aug 2011 01:58 PM
I had a square looking moniter, so i placed the GUI in the middle. Now I have a widescreen, and the GUI is offside. How do I make it so its centered for everyone?
Report Abuse
drgn42 is not online. drgn42
Joined: 11 Feb 2010
Total Posts: 3231
19 Aug 2011 01:58 PM
good question. can i get some help on that question also?
Report Abuse
Sehnsucht is not online. Sehnsucht
Joined: 10 Apr 2011
Total Posts: 990
19 Aug 2011 02:00 PM
Gui.Position = UDim2.new(0.5,-Gui.Size.X/2, 0.5, -Gui.Size.Y/2)
Report Abuse
Drak0Master is not online. Drak0Master
Joined: 10 Aug 2009
Total Posts: 836
19 Aug 2011 02:03 PM
How about sticking things to the right ? Any help on that one ?
Report Abuse
pwnedu46 is not online. pwnedu46
Joined: 23 May 2009
Total Posts: 7534
19 Aug 2011 02:04 PM
Make an invisible gui and size it to UDim2.new(1,0,1,0). Then get it's AbsoluteSize to find the screen size. Then divide the offset in the x and y coords by 2. Then subtract your gui's size from that number to center it.


______________________________________
~pwnedu46~
-I lost the game.-
Report Abuse
Sehnsucht is not online. Sehnsucht
Joined: 10 Apr 2011
Total Posts: 990
19 Aug 2011 02:04 PM
What do you mean sticking things to the right?
Report Abuse
pwnedu46 is not online. pwnedu46
Joined: 23 May 2009
Total Posts: 7534
19 Aug 2011 02:05 PM
raige! Sehnsucht beat me to it.

BTW, this belongs in building helpers, not scripting helpers.


______________________________________
~pwnedu46~
-I lost the game.-
Report Abuse
Drak0Master is not online. Drak0Master
Joined: 10 Aug 2009
Total Posts: 836
19 Aug 2011 02:10 PM
My bad... But anyways.. Same deal, just on the side of the screen.
Like if it were a small moniter and I just stuck it there, people on widescreens would see it in the middle ish.

I want to keep it to the right o:
Report Abuse
Sehnsucht is not online. Sehnsucht
Joined: 10 Apr 2011
Total Posts: 990
19 Aug 2011 02:12 PM
Still in the middle of the screen on the Y Axis though?

Gui.Position = UDim2.new(1, -Gui.Size.X/2, 0.5, -Gui.Size.Y/2)
Report Abuse
Drak0Master is not online. Drak0Master
Joined: 10 Aug 2009
Total Posts: 836
21 Aug 2011 08:04 AM
I tried using this in a script and it failed.

I simply do not understand.. Do I have to make the calculations manually?
Because then that would only center it for me.
I want a formula that can actually center the GUI frame IN GAME, for everyone...

Can anyone help me?
Report Abuse
Drak0Master is not online. Drak0Master
Joined: 10 Aug 2009
Total Posts: 836
21 Aug 2011 08:06 AM
Bump of hope? :L
Report Abuse
Drak0Master is not online. Drak0Master
Joined: 10 Aug 2009
Total Posts: 836
21 Aug 2011 08:14 AM
Bump of hopelessness.. :/
Report Abuse
xvgigakid is not online. xvgigakid
Joined: 22 Jun 2008
Total Posts: 4407
21 Aug 2011 08:23 AM
To position it right just make the size negative numbers

And the position make it 1 for X Scale.
Report Abuse
Drak0Master is not online. Drak0Master
Joined: 10 Aug 2009
Total Posts: 836
21 Aug 2011 08:42 AM
I did exactly what you said^.
& the gui ends up barely showing in the top right corner.
?:S
Report Abuse
xvgigakid is not online. xvgigakid
Joined: 22 Jun 2008
Total Posts: 4407
21 Aug 2011 08:46 AM
Ok do this,
Follow my instructions exactly

1.Create a Frame in ScreenGui
2.Set the Frame's size to Frame.Size = UDim2.new(-0.5,0,0.5,0) --X=Negative, Y=Positive
3.When increasing the size DEcrease it. So if its -0.5 make it -0.6.
Report Abuse
Drak0Master is not online. Drak0Master
Joined: 10 Aug 2009
Total Posts: 836
22 Aug 2011 11:05 PM
That just makes the gui go off screen to the left.
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
22 Aug 2011 11:08 PM
You were using Offset instead of Scale.

Offset = Your size screen (Say it is 13", you would be positioning it for a 13" screen, and rather on a 17" screen, you may not see the Gui)

Scale=It's the same position for everyone.

<'eof' expected near 'end' on line 9001>
Report Abuse
Drak0Master is not online. Drak0Master
Joined: 10 Aug 2009
Total Posts: 836
22 Aug 2011 11:11 PM
That makes sense. But how can I center it again? :s
Report Abuse
Drak0Master is not online. Drak0Master
Joined: 10 Aug 2009
Total Posts: 836
22 Aug 2011 11:12 PM
Do I just center it to my moniter and it will be centered for everyone?
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
22 Aug 2011 11:24 PM
Put the scale on both x/y 0.5

Scale goes from 0-1. so, you go into small numbers, like 0.1, or 0.05, or 0.55, stuff like that.



<'eof' expected near 'end' on line 9001>
Report Abuse
Drak0Master is not online. Drak0Master
Joined: 10 Aug 2009
Total Posts: 836
22 Aug 2011 11:30 PM
Does the same thing. Puts the gui to the left of the screen..

On size or position?
Report Abuse
Drak0Master is not online. Drak0Master
Joined: 10 Aug 2009
Total Posts: 836
22 Aug 2011 11:38 PM
Everyone is saying the same thing. Put scale to 0.5, but it doesn't work! .. :S:S
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
22 Aug 2011 11:40 PM
Ok. Lets test.

Make the size on scale 0.5 on both y and x (yes, size is the same thing), and make position 0.5 on both x and y

<'eof' expected near 'end' on line 9001>
Report Abuse
Drak0Master is not online. Drak0Master
Joined: 10 Aug 2009
Total Posts: 836
22 Aug 2011 11:48 PM
Okay, Size = {0.5,0},{0.5,0}
Position = {0.5,0},{0.5,0}

Result;

A massive frame in the bottom right corner.
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
22 Aug 2011 11:55 PM
Make the position 0.25, 0, 0.25, 0

______________________________________
-ElectricBlaze,

roblox.com/my/groups.aspx?gid=372
Join today for a scripting teacher!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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