Link to home
Start Free TrialLog in
Avatar of panJames
panJames

asked on

XNA, fading images

Hello experts!

This is my first XNA game.

I try to make my images fade.

I use:

color.A = it changes
spriteBatch.Draw(anims2DArray[animacjaRamkaId], screenRectangle, color);

it works fine but only when I erase screen by:

GraphicsDevice.Clear(Color.White);

It does not work at all for:

GraphicsDevice.Clear(Color.Black);

in this case, alpha channel seems to be irrelevant.

1. Why is it?
2. How can I make my images to fade?

thank you!

panJames
ASKER CERTIFIED SOLUTION
Avatar of saragani
saragani

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of panJames
panJames

ASKER

It helped.

Now I use:

Color.White * (changing value)

which fades all color channels at once, it gives fading effect.

But why does transparency channel depend on the background color?

panJames