UDim2 BorderRadius

Here is the idea, sort of like how CSS defines border-radius,

Would use a UDim2 for customizing each corner.
UDim2.new(Border-Top-Left, Border-Top-Right, Border-Bottom-Left, Border-Bottom-Right)

If the border radius is greater than the length of the sides it affects, then it will default to the length.
Also it must count in the other corners, so that it won’t overlap, and cause issues.

Like top left has 15 pixel radius, and the bottom left has 15 pixel radius, too get the whole 15 radius, you would need 30 pixels in height. if the radius is 20 on each, and the height is 30, than it will average out automatically to 15.

All gui elements will be affected, and allow border radius, maybe not scrolling frame, depends on how the scroll bar would work.

If you do
gui.BorderRadius = 15
then all corners will be set too 15.

Benefits:

  • Less images to be created and loaded to get curved buttons, therefore reducing storage usage on roblox servers by a very slight amount.
  • With this, you could create circle gui technically, just have a 30x30 frame with 15 border radius on all corners.
  • Better GUI in games, people could make much nicer looking gui with curves on their UI.

I always loved the GUI, but I feel this would improve it further.

4 Likes

This might be a good idea, but instead of supplying the corners I would rather have a property that allows you to give an amount of pixels offset from the corners that should be bent. So like, if I want to have 20x20 pixel rounded corners on the sides of my frames, I just supply the value 20 for this property for both the X and Y direction. I don’t know if many people would use the version where you can supply the corners yourself.

Sounds like a good idea, although putting this in a UDim2 for four separate values is a bit odd since that would imply that two of the values are scales instead of absolute values. Although what you could do is split this border radius into two components, one for the X-direction and one for the Y-direction, and then you can use a UDim2 to specify which part of the size in X/Y-direction is to be used for this border. Then you can also have elliptical borders instead of just perfectly round.

Ben is considering changing the current GUI system. A couple of others have suggested similar ideas, so you may be seeing this even sooner than you’d expect.