Resizing a ImageLabel like a Frame

That you that solved it! :slight_smile: But there is still one thing to fix.
When I have around 45 HP or lower I can’t see the red damage bar even though I still have some HP left, as the bar already moved too far down.
I think this may be because of the Rotation from the Gradient, but I don’t know.

Try manually setting the .Offset to find the end and start positions, then when you set the health set the .Offset to

uiGradient.Offset = minOffset + (maxOffset - minOffset)(currentHealth / maxHeath)

The problem is probably because the health bar image has some transparent space at the bottom, and the UIGradient makes that part transparent, even though there is already nothing there. If the health bar isn’t centered in the image, the rotation might mean the required min and max offsets might have negative or above 1 y values, respectively.

Could you send the code you used too?

This can be a easy fix depending on your code, if you divide the image/frame length by your max health you will get a number which we can call x, using the number x you can multiply that number by your current health and then set that to your image/frame size.

Guys I solved it! As you guys said I just had to remove the empty space around the bar. Thanks again!

1 Like

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