How to lineup gui to top of screen?

Hi devs,
Ive seen in games such as grow a garden and forsaken that they’re ui is often right at the top of the screen, but when i make ui, no matter how high up i put it, theres always a gap. Heres a pic from online of what im trying to achieve.

If i tried to replicate this, often it would put the “garden” icon more close to the fence than to the top of the screen, which can look unattractive.

Im guessing you would need to change the workspace/ players settings in script, or just in the screen guis properties.

If you have any idea how to do this, let me know!

Hey gamer,
To replicate this sort of UI element, here’s some properties you’ll need to know, I’ve used layman’s terms to describe them and gave you links to the Roblox documentation on these:

AnchorPoint: Where on the UI does the center lie? (0,0) = top left, (0.5,0.5) = directly center, (1,1,) = bottom right.

Position: Where on the screen the UI element will be located. Uses X and Y components, where the first number is scalar percentage and the second number is the raw pixel offset.

To have this UI, set the Anchor point to X = 0.5 (anchor point is set to center of the object)
Udim Position = {0.5,0,0,10} (position is set to the center of the screen on the X axis, then positioned 10 pixels downward from the top of your screen)

Oh, and make sure the ScreenGUI’s ignore UI insert property is set to True!

I hope this helps!

ExampleUI.rbxm (2.8 KB)

1 Like

I will get back to you whether it works or not, as im a little busy rn, but i forgot to say it was lined up with the top ib the studio, until i clicked play, then it was pushed down, i think by native Roblox ui on the left. Could you try launching to see if it still works? Sorry to bother :sweat_smile:

1 Like

This adjustment you’re seeing when you playtest your game is that your UI respects the built in GUI inset. That’s the bar at the top of your screen that contains the Roblox settings button, chat, etc. In this screenshot you can see that the white frame ignores the UI inset, whereas the red respects it!


IgnoreGUIInset will make it so the topbar does not influence the UI position!

4 Likes

Thanks, this is what im looking for, as well as ur other post. Thanks for the help!
My ui is in the red box whereas i want it to be in the right. I will turn on ignore gui inset!

1 Like

Awesome! Glad I could help you out!

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.