Hello Developers!
Some of you may know, however, it is possible to imitate ClipDescendants
with a UICorner
.
By creating a new CanvasGroup
inside of a ScreenGui
you are able to use it to clip the corners of its descendants.
After creating a new CanvasGroup
, you can add a UICorner
to the CanvasGroup
and adjust it to your liking.
Now that we have a UICorner
in place, you can add whatever you want!
In this example, I will insert a Frame
, ImageLabel
, and TextButton
into the CanvasGroup
.
The top-left is the Frame
, the middle-left is the ImageLabel
, and the bottom-right is the TextButton
.
I hope this helps anyone confused about UICorners
with ClipDescendants
.
FYI: This can be done with complete transparency. The blue background is only for showcase purposes.
46 Likes
Are CanvasGroups out of beta? Can they be used in games? Last time I checked they weren’t out yet but if they are this is awesome.
7 Likes
I am almost certain that they can be used. I will look at that right now. Thanks for letting me know about that!
6 Likes
Here is the link to the documentation if you want to read up on it:
From what I have read, they seem to be to a point where they can be used in-game.
6 Likes
Doomcolp
(dxxmed)
July 29, 2023, 3:05am
#5
Woah! This seems useful for making so weird lookin health bars or something like that.
I think I’m gonna save this and use this as a reference in the future. Thanks for sharing this!
7 Likes
CaelmDev
(Caelm)
August 7, 2023, 2:14pm
#6
Thank you so much for showing us this! Didn’t even know this was pssible until now…
The only annoying thing about this is that there aren’t as much properties as other frames, and when trying to add a UI element inside of it (this isn’t for the UI tab at the top of studio), the UI elements don’t show up first when I click the +
button.
2 Likes
That is odd. It is still in a working state I believe, however, I am almost certain it is out of Beta. Glad this helped!
How did you apply ClipDescendants on a canvasgroup?
“CanvasGroup always has GuiObject.ClipsDescendants set to true and all descendants will render within CanvasGroup’s viewport.”
This is directly quoted from the CanvasGroup documentation.
ultra_2033
(ultra_2033)
July 15, 2024, 11:31pm
#10
It’s because i tried this and it wasn’t working for me
Can I ask what exactly it is that you are trying to do and what isn’t working?
1 Like
CanvasGroup with UICorners was not affected by ClipDescendants
1 Like
I’ve tried it as well and it seems like it doesn’t work anymore:
1 Like
I am not entirely sure why it isn’t working. It still works for me:
1 Like
My appologies… In the previous post I realize it didn’t really prove your issue.
Here I have tried it again:
It does still appear to be working. I am unsure why it isn’t working for you, however, I have a couple of ideas:
Certain CanvasGroup
features may still be in Beta, which may be causing issues if you don’t have Beta Features enabled. (Unlikely, but possible)
The ScreenGui
’s ZIndexBehavior
property is set to “Global”. In order for the corners to clip, you must use the “Sibling” behavior:
I hope this helps!
1 Like