Even though I’m using scale instead of offset, and I’m using size constraints, the GUI still looks different in-game and in the studio. I’ve searched through the dev forum, but anything about this just told me to use scale, which I’m already using. If anyone knows the problem, please tell me! Thanks!
If I’m missing any information you need to solve this, please ask me.
In studio:
In game:
Positioning is a little more than just using scale. Sometimes, you need to configure the AnchorPoints of GUI objects. If you haven’t done so already, set the right bar’s AnchorPoint to 0.5, 1 so that it will be in the horizontal center, but vertical middle. Then, position your UI until it is where you want it to be. Then, it should stay there since the new AnchorPoint acts as the center point for positioning.
Hope that helps!
2 Likes
Thank you for the fast response!
I switched the bars to 0.5,1 for the anchor point and it worked for the bottom bar, but the right bar is still looking strange. I also tried using 1,0.5 for the right bar, but that didn’t work either. Any idea on how to fix it? Thanks!
1 Like
Alright, I fixed it:
GuiHelp.rbxl (24.3 KB)
I changed/added this:
-
I changed the right bar’s, the bottom bar’s, and (I think) the coin symbol’s AnchorPoint to 1, 1 to line it up with the right/bottom/bottom-right of the screen perfectly. And I also changed their positions to re-align them.
-
I added a Positioner script that basically looks like this and it just automatically positions the bottom bar, which needs to be done for only that due to the setup of the UIAspectRatioConstraints:
local frame = script.Parent
local coinSymbol = frame.Parent.CoinSymbol
local mouse = game.Players.LocalPlayer:GetMouse()
coinSymbol:GetPropertyChangedSignal("AbsoluteSize"):Connect(function()
frame.Position = UDim2.new(1 - (coinSymbol.AbsoluteSize.X / mouse.ViewSizeX), 0, 1, 0)
end)
I think that’s all, hopefully, I didn’t forget anything, but it’s maybe tweakin’ with them AnchorPoints! I didn’t change anything else so that you don’t have to change your UI system very much.
Glad I could help you!
1 Like