Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Trying to make a GUI expand while keeping to the same center point?

I have a Frame at the Top center of my screen and I want it to expand out on the X plane till it takes up the whole X plane at the top of my screen starting from the center and expanding out.

I have tried to make the GUI change position along with its size to keep it centered and make it look like it expanding out but I can't get the position math to keep with the size it always seems to get to long in positive direction.

I have also looked into anchor points but I can't seem to figure out how todo it with them.

local Frame = script Parent
local Percentage = NumValue.Value

Frame.Size = UDim2.new(Percentage,0,1,0)

local PosNum = --I can't figure out the math for this part to keep the frame in the same position so it looks like it explands out

Frame.Position = UDim2.new(PosNum,0,0,0)

1 comment

0

Assign Anchor-points.

1 answer

This is very easy In your frame you want to take up the hold X plane Change the size to 1,0, Your_Y_Scale, Your_Y_Offest

and for the future install this plugin: https://web.roblox.com/library/1496745047/AutoScale-Lite

Description: this is a Simple plugin that helps you scale your GUI on all screens! Change Position, Size to Scale/Offset and also add UIAspectRatio constraints with the Ratio property calculated for you!

Documentation: In DevForum Link DevForum: https://devforum.roblox.com/t/plugin-auto-scale-for-guis/217704 Tutorial:https://youtu.be/Mafquy7YQmA

Please read the documentation before leaving a dislike Hate clicking scale button a hundred times? Get AutoScale Plus for full automation!

Simple description: This plugin make it sodat your gui stays the same size on all screen sizes

2 comments

0

That's not what he meant.

0

I know how to keep my GUI the same on each screen I am on about it expanding outwards like a loading bar but going in both X directions not just one direction.

This discussion is preserved as it was. New answers, comments, and votes are closed.