So I am in the progress of adding a loading bar to a game and the problem is that the loading bar has rounded edges. So using this formula here:
bar.setWidth(originalWidth / 100 * progressLoaded);
Results in the curved edges being all squashed, instead I want to progressively show more of the bar as the progress increases, not increase it’s width.
So basically I want to set all the pixels to be transparent and then alter them to their original colors as the progress is increased.
So, is there a way to do this or do I need to make a shader, which I have never done before.