How do I slowly fade text?
Heyo, I'm trying to make my GUI fade when not in use. Specifically, for a Minecraft-style tool bar, I want it to pop in when a player uses the scroll wheel and fade away in a few seconds after they're done scrolling. The GUI is working perfectly, but I can't get this fading thing to work. I assume once I get the selection text working, the sprites will follow easily, so I'll just talk about the selection text for now. The inventoryText starts the game at full white.
^This results (when I move the scrollwheel) in the inventory text going full-white, and two seconds later shifting to a light grey. There is no sleek transition, and it is still clearly visible. This repeats every time I move the scrollwheel.
controllerInterface.inventoryText.CrossFadeAlpha(255f,0,false);
controllerInterface.inventoryText.CrossFadeAlpha(0f,2,false);
^This results (when I move the scrollwheel) in the inventory text going full-white, and two seconds later shifting to invisible. This repeats every time I move the scrollwheel. Apparently 0.1 alpha makes all the difference o_O
controllerInterface.inventoryText.color = Color.white;
controllerInterface.inventoryText.CrossFadeAlpha(0.1f,2,false);
^This results in the inventory text slowly fading to a light grey, but no change on scrollwheel.
Any ideas on what's going on, and how I can get my text to slowly fade to invisible exactly how I want?