How to create a gradient progress bar

Hi friends,

I want to draw a progress bar like this

44135-progressbar.png

I wrote code, but the effect is not gradient fill based on value. Its a solid color based on the value.

Can you please help me?

Take a look at this answer and look on how the alpha gradients are used. Its very usefull for this kind of progressbar.

Simply hide the rainbow texure behind your alpha gradient texture and change its alpha value with a script. This way the alpha texture will fade with the gradient and reveal your rainbow bar.

More details are in the answer above.

I solved this problem.

In Unity 4.6 GUI, also in NGUI you can select sprite type as Filled and Fill mode to radial with you desired fill direction.

Check out this asset, you can easily manipulate your gradient sprite