Problem With A Bar UI

Hello Developers,

Currently I’m making a Bar UI that tracks a currency. Everything is working fine except for the Ui it self. Currently I’m using image labels however when the Bar gets scaled on the X axis it becomes stretched in a weird size. I know about ScaleType = fit however this wouldn’t work as the ImageLabel needs to be stretched.

In Figma:


In Game:

If any could help by providing me a line of code that updates a property when it gets scaled then that would be very helpful.

1 Like

you need to use slice scaling and then adjust slice center as needed so that the middle part gets reused and the end parts stay the same

3 Likes

Hi, I tried that out and got a pretty neat result however would I need to update the slice center whenever I change the size of the bar mid-game? and would this also scale up for all devices?

For example here, it is perfect

while at the start its just like this

This is the size of the bar if you need it
{0.176, 0},{1, 0}
Slice Center: 40, 35, 50, 35
Slice Scale: 1

Edit: Played around with it and it worked! Thank you for your help @happya_x

1 Like

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