Tuesday, April 26, 2016

graphics - How do I make a progress bar with letters that get "filled in"?



I want to make a progress bar made of text! I have two images: One with the text in gray, the other coloured:


gray progress bar colored progress bar


As my game is loading, I want the letters to "fill up" with color:


filling-up progress bar


They would start out gray, then fill in.


I was thinking of overlaying a transparent rectangle over the gray image, then stretching the transparent rectangle to match the progress. But then the background will be coloured too. I want only the letters to be coloured!


How can I do this?



Answer



I don't know how this feature would be implemented in your specific development environment, but the solution to the problem you describe is masking.


Basically, apply a mask to the progress bar in the shape of your letters and then the stretched rectangle won't be rendered outside the mask.



No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...