How to make the White line to stay in the middle of the dark ui

Hello there :wave:,

  1. What do you want to achieve? Make the white line centered with the “Number-coin” (the dark one) ui when i change the size of the screen.

  2. What is the issue?

Here is what i did if it helps (Check the “solution” in the link below): i did the “NO PARENT” technique“ on “The black ui” with the texts: “Coin” and “Number”

result when the screen is over sized:

The white line glides to the right side while over sizing the screen

result when the screen is the desired size:

The white line is centered

Result when the screen is shrinked:

the white line glides to the left side while shrinking the screen.

Note :
here, the white line is a child of the “Number-coin” ui.
(it can also be unparented from the “Number-coin” , it’s the same result at the end)

i prefer unparented(But whatever works)

Thank you for your help :happy2:

2 Likes

You should be able to get it to stay in the center if you set the

  • AnchorPoint at 0.5, 0.5
  • Position at {0.5, 0},{0.5, 0}

It’s relative to it’s Parent, so if you want it in the middle of a frame it should be placed as a child of that frame.

3 Likes

sorry for the late reply, i was extremely busy.

But unfortunately your suggestion didn’t work.

i am going to try to change the size.

1 Like

send me your gui file, I’ll fix it

2 Likes

yo, r u still on for the help?

i can help! :point_up: :nerd_face:

(if you need still need help with this problem or other relevant things)

1 Like

yes, please, i would like that. do you also need a file?

yes, a file sent would be appreciated :+1:

1 Like

There you go, thank you so much for your help.
Gui-Number-Coins.rbxm (14.5 KB)

NumberCoin.rbxm (14.5 KB)

Like that right?

there are a lot of things in here using both scale and offset to resize and position objects

you should probably overhaul everything to use only scale.

coinGui.rbxl (53.7 KB)
here is my version of the fix.

the white line is now there, and 95% of the UI objects have now been switched to scale.
this will allow it to scale properly and cleanly from device to device.

i think you might have been using offset intentionally for some frames, but let me know if you need any help with that.

I can’t download your file. the file you sent is .rbxm. While roblox studio is .rbxl

Yeah… its a roblox file, you also had sent a rbxm file you just right click on explorer and click “Insert from file” or drag and drop the file from your file explorer into the viewport.

1 Like

Hello everyone,

I apologize for not being clear enough in my post. which may have led to misunderstandings. But I’ve adjusted the topic to better reflect my intentions and provide clarity.

Thank you for your patience and understanding. If you have any further questions or need additional clarification, please don’t hesitate to reach out.

TYSM! You did it (all i have to do is just scale the line at the desired size).

But can you pls explain what you did?

I updated the line position to {0.5, 0, 0.5, 0} and set the Line sizeconstraint to XY. Now similar to what @RainingMemory said I would adjust the scaling of the UI, now I wouldn’t recommend using all scale since it’ll deform your UI and it won’t look as you had originally designed it to be. I personally use a mixture of the new UIFlex items, offset and scale. I’ve left an example of what it’d all look like below.

Also if your wanting the line to work all the way down from the top to bottom it wouldn’t work the best with your the new method used but I did fix that in the example below.

Theres quite a few changes I had made so you’ll just had to look over it to get an understanding of what makes it work.
NumberCoin.rbxm

2 Likes

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