Resizing a slanted image UI for health bar

Currently, I’m making a health bar system that uses images that have a base background and the filling. The filling image uses a rhombus shape, and whenever I try to change its size, it keeps getting squashed as soon as it becomes really short (yes, I did use the 9-Slice approach).

The image gets squashed when it reaches the value below 0.126 on X-Axis
Screenshot 2024-10-07 181412

I tried using the ClipsDescendants method, and it works. However, it takes away the rhombus shape from the image.
Screenshot 2024-10-07 181545

Is there a way to change the size of the image while keeping the shape at the same time? or is the image itself the problem :sob: :sob: :sob:

2 Likes

I dont think you should be scaling the UI, as again, it squashes, instead you should use a UIGradient, and make part of the bar go to invisible, it has about the same effect.

1 Like

This does the same thing as using the ClipsDescendants method which takes away the shape of the filling.

Nevermind I found out the solution for this. Instead of resizing, changing the position of the filling and using ClipDescendants at the same time will keep its shape.

1 Like

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