2
« on: November 22, 2016, 09:23:03 AM »
Hello!
I have a couple of problems with using sliced images as foreground for progress bars:
1. When the progress bar reaches a low enough point that only the left and right border are still visible, it disappears. Say for an example that i have 7 px border on the left and 7 px border on the right. When the progress bar goes below 14 px in width it disappears, pops. It seems that when there is no "mid-part" left, everything else vanishes.
2. When the progress bar is maybe 10% away from the critical "popping point" described above, it does this weird distortion thing where it seems to shrink in height and simultaneously stretch the sprite (see attached screenshot).
3. Due to the above problems (I think), I also have an issue where the end of the fill/foreground isn't where it says it is. If I set the slider value to be 0.5, you would think that the end of the fill should be in the middle of the background but it's not. It's offset, and the offset varies depending on the amount of progress (0-1). At the project I'm currently working on, I would need it to be exactly where it says.
Any tips on how to tackle these problems would be appreciated. If these are not bugs, but just the way NGUI works, do you have any tips on how to create health/progress bars with rounded rectangles that don't stretch?
The sprite in the attached image has 12 px border on all four sides. The result is same on other sprites.