of     1   

BobCowMan
#182213338Saturday, January 23, 2016 5:53 AM GMT

How do you get the GUI positions to move positions based on their centers rather than the left edge? I'm constantly having to adjust a GUI just to get it in the middle of the screen -.- If someone has a better way please elaborate 3:8 BCM / Speedyseat(co-owner)
128Gigabytes
#182213778Saturday, January 23, 2016 6:02 AM GMT

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
SunTzu16
#182214062Saturday, January 23, 2016 6:08 AM GMT

If you're in studio, you just use a calculator or something to divide it in half. So, if you want to center the GUI, (using the position that scales to the screen), you could just take the size of the GUI, say it's 0.4, or 40% of the screen... (both ways) Then the position is 0.5 (or centered), you take 0.4 divided by 2 = 0.2 0.5 - 02 = 0.3 You'd position it at 0.3 for both directions.
128Gigabytes
#182214968Saturday, January 23, 2016 6:29 AM GMT

'You'd position it at 0.3 for both directions. ' Only if the x and y are both the same, also you forgot to include what to do for offset Its -(offset / 2) The algorithm I posted does it for x scale, x offset, y scale, y offset at the same time.
BobCowMan
#182215057Saturday, January 23, 2016 6:32 AM GMT

Thanks for both responses 128, thank you it works like a charm 3:8 BCM / Speedyseat(co-owner)
SonyController
#182215356Saturday, January 23, 2016 6:39 AM GMT

We want a plugin that allows for dragable GUIs meow. -SonyController, Up-And-Coming ROBLOX/Unity Dev
128Gigabytes
#182215408Saturday, January 23, 2016 6:41 AM GMT

All you would have to do is set the guis draggable property to true and parent it to core gui.
SunTzu16
#182217093Saturday, January 23, 2016 7:30 AM GMT

I did say both would be 0.4 for size. I never bother with offset, except for very specific situations, lol Still, it's the same idea.
128Gigabytes
#182217157Saturday, January 23, 2016 7:32 AM GMT

I see that now, sorry But its really not the same idea One is (0.5 - (x / 2)) The other is -(x / 2) Similar looking I suppose.
SunTzu16
#182217211Saturday, January 23, 2016 7:34 AM GMT

Yeah, just figured I'd give him another point of view to it to help out. I don't use offset, so I wouldn't know where to begin with it. lol Scale works better most of the time.
128Gigabytes
#182217256Saturday, January 23, 2016 7:36 AM GMT

If you use only scale your gui will end up very jacked up on other peoples screens
SunTzu16
#182217453Saturday, January 23, 2016 7:42 AM GMT

It scales to their screens. Most stuff I do is like, either really simple like an ammo display for a gun, which would scale with their screen across the top of their toolbar... Or, it'd be a full screen GUI, and everything is positioned and scaled via percent. I can't really think of any reason to use offset atm. :/ If you're not careful, people with large screens will have very tiny buttons to click, and vice versa, a small screen would have huge buttons that cover the entire screen. htt p://prn tscr. com/9tomgr htt p://prn tscr. com/9tomjl
sayhisam1
#182218257Saturday, January 23, 2016 8:07 AM GMT

Offset is incredibly useful in certain cases, especially when using text, since TextScaling is ugly, and having lots of empty space in a box is also ugly.
LongKillKreations
#182219990Saturday, January 23, 2016 9:11 AM GMT

Offset > Scale With offset, you can guarantee your GUIs look the same on all screens. Also, some people have terribad aspect ratios.
SunTzu16
#182230698Saturday, January 23, 2016 3:28 PM GMT

I've only ever had complaints using offset back years ago when I first started using GUIs, lol... Most people prefer scaling in my environment, so, I go with scaling... Offset makes things look, in a relative way, different for every user with a different aspect ratio or screen size. That's the nature of offset. Sometimes this is a good thing, and other times it's a bad thing. I realized how horrible offset can be at times when my little brother opened one of my GUIs and on his 24" screen or so it was horribly tiny, while on my screen it fit perfectly. I had to convert everything to make it stay true to its design among all users. I think the only issues with scaling will revolve around mobile devices that have a taller layout... but I've never used one, and perhaps it flips from portrait to landscape anyway. ROBLOX isn't very great at scaling in narrow situations, which can be observed in studio. I had to create a responsive website for my highschool a while back, and many of the same principles apply there as well. An offset of 100 or so pixels looks entirely different for different devices, so we used style sheets that based themselves of the size of the user's screen. Idk, I mean, it's probably a matter of preference, but you can't tell me that offset will make things look the same for all users... That's both true and false depending on perspective, and that's what most opinions are based on, perspective. I'll continue using scale until I see a really good reason not to. And when I do, I guess I'll need to stop using GUIs, because there's already plenty of reasons not to use offset. lol
LongKillKreations
#182240237Saturday, January 23, 2016 5:56 PM GMT

it's just a matter of being smart about how you use offset
Aethex
#182240390Saturday, January 23, 2016 5:57 PM GMT

if only roblox supported css for guis :(
JarodOfOrbiter
#182240973Saturday, January 23, 2016 6:05 PM GMT

"if only roblox supported css for guis :(" Someone should remake Anaminus' Gloo GUI Library. You could probably make it similar to CSS and make it fully modernized, with support for aspect ratio preservation and stuff.

    of     1