UICorner Individual Corners

?

I meant it can return the CornerRadius kind of the same way Color Graduation does for ParticleEmitters

1 Like

Issue with CanvasGroups is it renders as an image thus reducing the overall quality of the Interface, The thing I hate about roblox the most whenever they do something right they completely screw up something else and this is one of those cases.

4 Likes

About a week ago now, I had made this UI:
IMG_7394

The image has been compressed by Discord and Discourse (twice) at this point so what I’m trying to say might not be very clear, but the text quality is very obviously lower than it should be. If I remember in the morning, I’ll show a comparison, but the point is that having 2 CanvasGroups inside of each other will degrade the quality by a lot.

4 Likes

Bump. I’ve been wanting this ever since UICorner was introduced. There’s so many situations in UI design where you’d only want some of the corners rounded.

This is an old menu I made that would benefit from this:


In this situation I opted to just use custom images with 9Slice because the top and side bars only need 1-2 corners rounded.

2 Likes

Found the solution. Using Udim2 you can set Scale and Pixel values separately

ScaleBorderRadius: Udim2.new(0, 0, 0, 0) TopLeft, TopRight, BottomLeft, BottomRight.
PixelBorderRadius: Udim2.new(0, 0, 0, 0)

Also, Roblox can impliment a solution where just typing the number of BorderRadius inside without fully completing it, Roblox can automatically fill it in similar to AnchorPoint where as you can simply type “0.5” to make it “0.5, 0.5”. However, AnchorPoints use Vector2.new() so there could be a slight difference.

Further more, Roblox can add a RelativeTo property where ScaleBorderRadius will act upon, such as:
XY (Normal)
XX (Y will be replcaed with X scale)
YY (X will be replaced with Y scale)
YX (Normal Inverted)

RelativeTo is a simpler way to not use AspectRatios for Frames.

What if Roblox added a property that lets you choose between them? Ability to change all at once or individual corner?

Code may look like this:

if script.Parent.CornerUI.BorderRadiusType == Enum.BorderRadiusType.Individual then
     return script.Parent.CornerUI.TopLeftCornerRadius
elseif script.Parent.CornerUI.BorderRadiusType == Enum.BorderRadiusType.Combined then
     return script.Parent.CornerUI.CornerRadius
end

UDim2 doesn’t work with UICorner, unless I am minunderstanding something

Yes, but judging the circumstances of extra added properties it would be common to use Udim2.new(), currently no, you’re right, you cannot use Udim2.new() on the current CornerUI.