4
\$\begingroup\$

How would one go about gradually fading a sprite from one color to another?

\$\endgroup\$

1 Answer 1

7
\$\begingroup\$

Use Color.Lerp to interpolate between two colours. See the MSDN documentation. Pass this as the color to SpriteBatch.Draw.

The arguments to Color.Lerp are the two colours you want to fade between, and a fade amount between 0 and 1.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .