I need assistance with my custom progress bar

Hey developers,

I’m sure everyone has played a battlegrounds game. I’m not making another clone, but I wanted to make a similar ultimate bar. However, I don’t know how I can prevent an overflow of the inside bar going outside the image. Here is my bar, an imageLabel:

image

I want the inside to fill up with the progress bar I have shown below, but it goes outside of it.

image

I’ve already tried using a CanvasGroup and ClipDescendents, but it just doesn’t work since the imageLabel outline is a box, and the image label has custom edges.

Any help is appreciated, and if there was already a similar topic or tutorial posted please link it!

2 Likes

Currently not possible, the 2D engine doesn’t have features like masking. The best way is to create your full bar image with your desired dimension, put that inside a Frame with ClipsDescendant enabled which is the GuiObject that resizes.

The only caveat with this method is that your bar image itself has to use offset size to prevent it from automatically resizing.

1 Like

Thanks for the information, i’ll be doing that right now.

aspect ratio constraints negate this problem, thanks for the warning regardless!!

2 Likes

It completely crossed my mind that this is possible. Thank you for the additional information!

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.