Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Need help with GUI's?

Asked by 10 years ago

I know quite a bit about GUI's just one thing that annoys me! How do you make it so TextLabel's, Frames, TextButton's are the same size on EVERY TYPE OF SCREEN. I know that if you make anything 1,0,1,0 size it will fit a screen BUT I was experimenting (my screen is 26inc) and some of the text buttons and stuff WHERE NOT SEE-ABLE - (outside the screen) so what I do is make the GUI's small enough for all screens to be able to fit! But it looks quite small and DULL for people with bigger screens. When I notice resolution doesn't really change things it really got me... Like some people with laptop screens that are smaller than mine DIDN'T FIT some of the GUI! Is there a script that can detect all this? OR AM I WRONG someone help and correct me with this PLEASE! Or is it a bug for me?

-UPDATE 1 Can someone please explain how to size TextLabel, TextButtons, Frames so ANYONE can see on any size'd monitor?

-UPDATE 2 26inc MONITOR - http://prntscr.com/4pj0iw 24inc MONITOR - http://prntscr.com/4pj1ib LOWER COULD NOT BE SEEN (this is not a real but its an example)

2 answers

Log in to vote
2
Answered by
KarlXYZ 120
10 years ago

The numbers you're using are for scale, which will change depending on screen resolution.

(1,0)(1,0) for a size will fill the whole screen, whereas (0,50)(0,50) will create a 50 by 50 pixel box.

It's probably best if you use the scales ((g,0)(g,0))* to position your GUIs, and use the pixels ((0,g)(0,g))* to size the boxes, this will ensure a consistent viewing across a wide range of screen resolutions.

If you wish to achieve a centered GUI then simply half the pixels and make them a negative number on each axis and use 0.5 for the scale.

For example: A 100 (x axis(horizontal)) by 200 (y axis(vertical)) pixel box centered in the middle of the screen will have a size of (0,100)(0,200). The position will be (0.5,-50)(0.5,-100).

Also, always remember that a GUI's position/size it always measured from the top left corner of the GUI.

If you need any more help, maybe consider checking out this article on the ROBLOX wiki.

*g shows what I'm referencing to, whether that be the scales or pixels.

Ad
Log in to vote
0
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
10 years ago

Previous Answer Explaining UDim2

Previous Answer about Constitent Placement of GUIs


  • Use Scale as much as possible.

  • Any Offset should be small (tiny adjustments only) -- smaller than, say, 40, unless...

  • ...unless you have convinced yourself that the size in pixels will work on any screen (e.g., a 200px centered button will be OK on screens at least 200px wide (all of them); a GUI that is 400px to the left of the center will require probably more than 850px wide screen, which may no longer support small screens or mobile devices)

  • ...or unless you are recomputing sizes dynamically by using scripts to fit to the screen size

  • ...or you are using some sort of scrolling context that makes the sum height or width of many items not matter if it exceeds the screen's size

Answer this question