Tired of doing math to position your guis correctly? Well this plugin is just for you. With a click of a button you can position a GuiElement within it’s parent into the center, top left, top center, top right, middle left, middle right, bottom left, bottom center, or bottom right!
This has a lot of potential but it’s not quite there yet. First problem I encountered was that you take up like 10 plugin buttons… It’d be much easier for people running lower resolutions if you just made one plugin to open a list of option in a separate GUI in the CoreGUI.
The second problem is that you don’t let us configure how we want it to be positioned. Scale? Offset? Both?
Thanks for the suggestions! I too was a bit concerened about how much space it took up so I will probably make it prompt a seperate interface. But about the scale and offset, I don’t understand what you mean. It sets the UI element using both scale and offset properties. E.I Bottom right is UDim2new(1-scale,-offset,1-scale,-offset). How else would I allow the player to configure? @ScriptOn
Make checkbox’s saying ‘Scale’ & "Offset’
Scale would position the object by absoluteposition/size divided by the parents absoluteposition/size or whatnot.
Offset would just be AbsoluteSize1-AbsoluteSize2
Having them both checked would do both of them or something. It’s up to you.
Hot. Maybe try removing the text under the images? It’s pretty easy to understand and would (ironically) save valuable screen estate if you made it more compact.
Well actually I was wondering what you meant by scale and offset. Because I’ve had like two other people suggest it and i’m not sure what people want with just scale or just offset. Isn’t there only one way to “lock” to a corner?
I also added buffer pixels bc that’s useful; atleast to me @ScriptOn
Use the offset and the scale positions for offsets. I’m not sure how else to explain it.
@ScriptOn Ah
So like for the just offset the center would be like
UDim2.new(0,screensize-(screensizesize.scale+size.offset),0,screensize-(screensizesize.scale+size.offset))
If i understand correctly?
And just scale would be converting pixels to scale?
There’s a lot of talk on customizing with scale and offset, but honestly, I think you have it right already. Why would you ever want to skip one or the other? Disabling either scale or offset would put you back to the position where you’re designing for a screen the exact size as your studio window, and that’s a dangerous move.
The one “special case” might be if the parent Gui element has a size which only defines offset, you could safely use offset only. But, there isn’t much incentive to do things that way, so I would skip it.
@blobblyblob
I was thinking the same thing; why would you ever not want both scale and offset.
But ScriptOn wasn’t the only one to suggest it…
So might as well allow the dev to have a choice.
ScreenGUI’s (in my current game) rely heavily on this. Also there are certain things in games that shouldn’t scale. Look at the PlayerList GUI for instance.
ScriptOn, it’s safe to say that the size of your particular Gui shouldn’t scale, but the position should be determined with scale. In fact, his plugin shouldn’t touch the size of the element at all. You resize the element using the UDim2, then hit a button to push it into a corner. This only changes position.
Ripepperoni, I think adding the choice will result in a checkbox that people feel tempted to “mess around with”, but provides them no benefit. I would still suggest you skip it. It will only serve to confuse users.
Does the gui’s auto scale, or do i have to scale the gui after?
@Master 3395
I am confused by the question. It uses the current size of the frame and uses both scale and offset to posistion it in the proper position according to where you want it (center, bottom left, top right, etc.)