- Home /
How to fade an image
I'm trying to fade in a background image. I've managed to make it work with a background colour
deathMenuImg.color = Color.Lerp(new Color(0, 0, 0, 0), Color.black, transition);
But I'd like to do it using an image I made
Anyone have any suggestions
Comment
Exactly as you've done it, but use white (zero alpha) to solid white ins$$anonymous$$d.
death$$anonymous$$enuImg.color = Color.Lerp(new Color(1,1, 1, 0), Color.white, transition
Answer by aoun111 · Jul 04, 2019 at 09:05 PM
If it is part of GUI, then simply animate the alpha channel of the color of the image / raw image. If you want it to fade in, first frame should be having alpha = 0, and the last frame should have alpha = 255. Opposite goes for fading out.
Your answer
Follow this Question
Related Questions
Lerping/Fading between multiple colours 1 Answer
Color lerp once? 2 Answers
[4.6 UI] Image fading - How to? 2 Answers
How to change the alpha element of particles/additive color? 1 Answer