I am making a UI with a button and I want the button to be smaller than the frame while staying equal on all sides. But with the button’s scale on both 0.9, it’s not equal because of how scale works.
the button is obviously not equally sized on all sides, but I want it to be,like this:
is there any automatic way to do this?
1 Like
Hello there!
You can set the anchor point of the button to 0.5, 0.5, so it gets placed in the middle of the frame
Hope it helps 
1 Like
yeah I do that, I just need the size to be equal on all side but automaicl
1 Like
Sorry, haven’t undertood it right
I see it now
Had this problem too a while ago.
You can solve this by finding a fraction that makes it look good or you can use the offset instead of the scale
1 Like
Ok heres what you are gonna want to do.
The inside part, set its size to 1,0,1,0 making it take up the whole frame of its parent,
Next add a UIPadding into the parent.
After that set each padding value of the UIPadding to like 0,4.
It should now be something like you wanted, you can change the values if you’d like to make the gap bigger or smaller.
it basically does what the person above said just minus you doing any math
It also works with any size the button gets set to, it’ll automatically update.
Very useful ik lol
I think that Roblox has border settings on ui elements, try finding then on properties
another way to make it be almost exact is by using a script
local BorderSize = 3
local XPercentage = 1 - (BorderSize / Frame.AbsoluteSize.X)
local YPercentage = 1 - (BorderSize / Frame.AbsoluteSize.Y)
Button.Size = Udim2.new(XPercentage, 0, YPercentage,0)
Hope it works
You can take the size of the white frame, for example X = 100 and Y = 15 (pixels)
Then subtract it by the number that would define the width of the border, lets take 2 pixels
Then X = 98 and Y = 13, this would be the size of the button
You can position the button in the middle
If you want to convert the size to scale then you can use this plugin:
Or you could just change the BorderSizePixel property on the text button element